fix: 产品分类组件替换自测

This commit is contained in:
leiqiaochu 2023-03-13 16:39:55 +08:00
parent 9e7e82b358
commit add3a9a5f3
5 changed files with 69 additions and 76 deletions

View File

@ -1,6 +1,6 @@
<!-- 新增编辑弹窗 --> <!-- 新增编辑弹窗 -->
<template> <template>
<a-modal <j-modal
:title="props.title" :title="props.title"
:maskClosable="false" :maskClosable="false"
destroy-on-close destroy-on-close
@ -11,38 +11,38 @@
cancelText="取消" cancelText="取消"
v-bind="layout" v-bind="layout"
> >
<a-form <j-form
layout="vertical" layout="vertical"
ref="formRef" ref="formRef"
:rules="rules" :rules="rules"
:model="formModel" :model="formModel"
> >
<a-form-item label="名称" name="name"> <j-form-item label="名称" name="name">
<a-input <j-input
v-model:value="formModel.name" v-model:value="formModel.name"
:maxlength="64" :maxlength="64"
placeholder="请输入名称" placeholder="请输入名称"
/> />
</a-form-item> </j-form-item>
<a-form-item label="排序" name="sortIndex"> <j-form-item label="排序" name="sortIndex">
<a-input-number <j-input-number
style="width: 100%" style="width: 100%"
id="inputNumber" id="inputNumber"
v-model:value="formModel.sortIndex" v-model:value="formModel.sortIndex"
:min="1" :min="1"
placeholder="请输入排序" placeholder="请输入排序"
/> />
</a-form-item> </j-form-item>
<a-form-item label="说明"> <j-form-item label="说明">
<a-textarea <j-textarea
v-model:value="formModel.description" v-model:value="formModel.description"
show-count show-count
:maxlength="200" :maxlength="200"
placeholder="请输入说明" placeholder="请输入说明"
/> />
</a-form-item> </j-form-item>
</a-form> </j-form>
</a-modal> </j-modal>
</template> </template>
<script setup lang="ts" name="modifyModal"> <script setup lang="ts" name="modifyModal">
import { PropType } from 'vue'; import { PropType } from 'vue';
@ -111,20 +111,20 @@ const submitData = async () => {
if (props.isChild === 1) { if (props.isChild === 1) {
addParams.value = { addParams.value = {
...formModel.value, ...formModel.value,
sortIndex: // sortIndex:
childArr.value[childArr.value.length - 1].sortIndex + 1, // childArr.value[childArr.value.length - 1].sortIndex + 1,
parentId: addObj.value.id, parentId: addObj.value.id,
}; };
} else if (props.isChild === 2) { } else if (props.isChild === 2) {
addParams.value = { addParams.value = {
parentId: addObj.value.id, parentId: addObj.value.id,
...formModel.value, ...formModel.value,
sortIndex: 1, // sortIndex: 1,
}; };
} else if (props.isChild === 3) { } else if (props.isChild === 3) {
addParams.value = { addParams.value = {
...formModel.value, ...formModel.value,
sortIndex: arr.value[arr.value.length - 1].sortIndex + 1, // sortIndex: arr.value[arr.value.length - 1].sortIndex + 1,
}; };
} }
const res = await saveTree(addParams.value); const res = await saveTree(addParams.value);

View File

@ -1,12 +1,12 @@
<!--产品分类 --> <!--产品分类 -->
<template> <template>
<a-card class="product-category"> <page-container>
<Search <pro-search
:columns="query.columns" :columns="query.columns"
target="category" target="category"
@search="handleSearch" @search="handleSearch"
/> />
<JTable <JProTable
ref="tableRef" ref="tableRef"
:columns="table.columns" :columns="table.columns"
:dataSource="dataSource" :dataSource="dataSource"
@ -25,46 +25,38 @@
:loading="tableLoading" :loading="tableLoading"
> >
<template #headerTitle> <template #headerTitle>
<a-button type="primary" @click="add" <PermissionButton
><plus-outlined />新增</a-button type="primary"
@click="add"
hasPermission="device/Category:add"
> >
<template #icon><AIcon type="PlusOutlined" /></template>
新增
</PermissionButton>
</template> </template>
<template #action="slotProps"> <template #action="slotProps">
<a-space :size="16"> <j-space :size="16">
<a-tooltip <template
v-for="i in getActions(slotProps, 'table')" v-for="i in getActions(slotProps, 'table')"
:key="i.key" :key="i.key"
v-bind="i.tooltip"
> >
<a-popconfirm <PermissionButton
v-if="i.popConfirm"
v-bind="i.popConfirm"
:disabled="i.disabled" :disabled="i.disabled"
> :popConfirm="i.popConfirm"
<a-button :hasPermission="'device/Category:' + i.key"
:disabled="i.disabled" :tooltip="{
style="padding: 0" ...i.tooltip,
type="link" }"
><AIcon :type="i.icon" @click="i.onClick"
/></a-button>
</a-popconfirm>
<a-button
style="padding: 0"
type="link" type="link"
v-else style="padding: 0px"
@click="i.onClick && i.onClick(slotProps)"
> >
<a-button <template #icon><AIcon :type="i.icon" /></template>
:disabled="i.disabled" </PermissionButton>
style="padding: 0" </template>
type="link" </j-space>
><AIcon :type="i.icon"
/></a-button>
</a-button>
</a-tooltip>
</a-space>
</template> </template>
</JTable> </JProTable>
<!-- 新增和编辑弹窗 --> <!-- 新增和编辑弹窗 -->
<ModifyModal <ModifyModal
ref="modifyRef" ref="modifyRef"
@ -74,7 +66,7 @@
:isChild="isChild" :isChild="isChild"
@refresh="refresh" @refresh="refresh"
/> />
</a-card> </page-container>
</template> </template>
<script lang="ts" name="Category" setup> <script lang="ts" name="Category" setup>
import { queryTree, deleteTree } from '@/api/device/category'; import { queryTree, deleteTree } from '@/api/device/category';
@ -146,6 +138,7 @@ const getTableData = async () => {
if (res.status === 200) { if (res.status === 200) {
dataSource.value = res.result; dataSource.value = res.result;
} }
tableLoading.value = false;
}; };
getTableData(); getTableData();
/** /**
@ -168,7 +161,7 @@ const getActions = (
if (!data) return []; if (!data) return [];
const actions = [ const actions = [
{ {
key: 'edit', key: 'update',
text: '编辑', text: '编辑',
tooltip: { tooltip: {
title: '编辑', title: '编辑',
@ -238,8 +231,8 @@ const table = reactive({
}, },
{ {
title: '说明', title: '说明',
dataIndex: 'describe', dataIndex: 'description',
key: 'describe', key: 'description',
}, },
{ {
title: '操作', title: '操作',

View File

@ -336,7 +336,7 @@ const setDevMesChartOption = (
grid: { grid: {
top: '2%', top: '2%',
bottom: '5%', bottom: '5%',
left: maxY > 100000 ? '90px' : '50px', left: maxY > 100000 ? '90px' : '60px',
right: '50px', right: '50px',
}, },
series: [ series: [

View File

@ -16,22 +16,22 @@
}} }}
</div> </div>
<div class="new-alarm-item-content"> <div class="new-alarm-item-content">
<a-tooltip <j-tooltip
:title="item.alarmName" :title="item.alarmName"
placement="topLeft" placement="topLeft"
> >
<a @click="()=>{return jumpDetail(item)}">{{ item.alarmName }}</a> <a @click="()=>{return jumpDetail(item)}">{{ item.alarmName }}</a>
</a-tooltip> </j-tooltip>
</div> </div>
<div class="new-alarm-item-state"> <div class="new-alarm-item-state">
<a-badge <j-badge
:status=" :status="
item.state?.value === 'warning' item.state?.value === 'warning'
? 'error' ? 'error'
: 'default' : 'default'
" "
> >
</a-badge> </j-badge>
<span <span
:class=" :class="
item.state?.value === 'warning' item.state?.value === 'warning'
@ -55,7 +55,7 @@
</ul> </ul>
</div> </div>
<div v-else class="empty-body"> <div v-else class="empty-body">
<a-empty :image="Empty.PRESENTED_IMAGE_SIMPLE"></a-empty> <j-empty :image="Empty.PRESENTED_IMAGE_SIMPLE"></j-empty>
</div> </div>
</div> </div>
</template> </template>
@ -73,7 +73,7 @@ const props = defineProps({
}); });
const menuStore = useMenuStore(); const menuStore = useMenuStore();
const jumpDetail = (item:any) =>{ const jumpDetail = (item:any) =>{
menuStore.jumpPage(`rule-engine/Alarm/Log/Detail`,{id:item.id},{detail:true}); menuStore.jumpPage(`rule-engine/Alarm/Log/Detail`,{id:item.id,detail:true});
} }
</script> </script>
<style scoped lang="less"> <style scoped lang="less">

View File

@ -1,8 +1,8 @@
<template> <template>
<page-container> <page-container>
<div class="DashBoardBox"> <div class="DashBoardBox">
<a-row :gutter="24"> <j-row :gutter="24">
<a-col :span="6"> <j-col :span="6">
<TopCard <TopCard
title="今日告警" title="今日告警"
:value="state.today" :value="state.today"
@ -10,33 +10,33 @@
> >
<Charts :options="state.fifteenOptions"></Charts> <Charts :options="state.fifteenOptions"></Charts>
</TopCard> </TopCard>
</a-col> </j-col>
<a-col :span="6"> <j-col :span="6">
<TopCard <TopCard
title="告警配置" title="告警配置"
:value="state.config" :value="state.config"
:footer="alarmState" :footer="alarmState"
:img="getImage('/device/device-number.png')" :img="getImage('/device/device-number.png')"
></TopCard> ></TopCard>
</a-col> </j-col>
<a-col :span="12"> <j-col :span="12">
<NewAlarm :alarm-list="state.alarmList"></NewAlarm> <NewAlarm :alarm-list="state.alarmList"></NewAlarm>
</a-col> </j-col>
</a-row> </j-row>
<a-row :gutter="24"> <j-row :gutter="24">
<a-col :span="24"> <j-col :span="24">
<div class="alarm-card"> <div class="alarm-card">
<Guide> <Guide>
<template #title> <template #title>
<span style="margin-right: 24px">告警统计</span> <span style="margin-right: 24px">告警统计</span>
<a-select <j-select
style="width: 40%" style="width: 40%"
v-model:value="queryCodition.targetType" v-model:value="queryCodition.targetType"
:options=" :options="
isNoCommunity ? selectOpt1 : selectOpt2 isNoCommunity ? selectOpt1 : selectOpt2
" "
@change="selectChange" @change="selectChange"
></a-select> ></j-select>
</template> </template>
<template #extra> <template #extra>
<TimeSelect <TimeSelect
@ -63,13 +63,13 @@
</li> </li>
</ul> </ul>
<div v-else class="empty-body"> <div v-else class="empty-body">
<a-empty :image="Empty.PRESENTED_IMAGE_SIMPLE"></a-empty> <j-empty :image="Empty.PRESENTED_IMAGE_SIMPLE"></j-empty>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</a-col> </j-col>
</a-row> </j-row>
</div> </div>
</page-container> </page-container>
</template> </template>