Browse Source

Merge pull request 'fix:修改按钮位置及样式' (#32) from dev-xjf into master

Reviewed-on: http://120.26.116.243:3000/root/alert-front/pulls/32
xiaojinfei-patch-3
xiaojinfei 3 weeks ago
parent
commit
c6d425e908
  1. 15222
      pnpm-lock.yaml
  2. 9
      src/views/exa/HistoryLine.vue
  3. 4
      src/views/exa/config/HistoryModal.vue
  4. 25
      src/views/exa/config/index.vue
  5. 9
      src/views/exa/exa.data.ts
  6. 17
      src/views/exa/history/PointModal.vue
  7. 2
      src/views/exa/history/index.vue
  8. 11
      src/views/run/instant/index.vue

15222
pnpm-lock.yaml

File diff suppressed because it is too large

9
src/views/exa/HistoryLine.vue

@ -3,6 +3,7 @@ import type { Ref } from 'vue'
import { onMounted, ref, watch } from 'vue'
import type { YAXisOption } from 'echarts/types/dist/shared'
import moment from 'moment'
import { Empty } from 'ant-design-vue'
import { useECharts } from '@/hooks/web/useECharts'
import { propTypes } from '@/utils/propTypes'
@ -85,7 +86,7 @@ watch(
x: '2%',
y: '5%',
x2: '2%',
y2: '30%',
y2: '10%',
containLabel: false,
// width: {totalWidth} - x - x2,
// height: {totalHeight} - y - y2,
@ -185,5 +186,9 @@ watch(
</script>
<template>
<div ref="chartRef" :style="{ width, height }" />
<div v-if="name.length === 0" :style="{ width, height, display: 'flex', justifyContent: 'center', alignItems: 'center' }">
<Empty />
</div>
<div v-else ref="chartRef" :style="{ width, height }" />
</template>

4
src/views/exa/config/HistoryModal.vue

@ -80,10 +80,10 @@ async function handleSubmitR() {
</script>
<template>
<BasicModal v-bind="$attrs" title="历史曲线" width="80%" @register="registerHistoryModal">
<BasicModal :min-height="300" v-bind="$attrs" title="历史曲线" width="60%" @register="registerHistoryModal">
<BasicForm @register="registerForm" @submit="handleSubmitR" />
<Card :loading="loading">
<HistoryLine :data="historyData" :name="legendName" height="500px" />
<HistoryLine :data="historyData" :name="legendName" height="40vh" />
</Card>
</BasicModal>
</template>

25
src/views/exa/config/index.vue

@ -1,5 +1,6 @@
<script lang="ts" setup>
import { onMounted, onUnmounted, ref } from 'vue'
import { Space } from 'ant-design-vue'
import { columns, searchFormSchema } from '../exa.data'
import EXAModal from './EXAModal.vue'
import CreateBatchModal from './CreateBatchModal.vue'
@ -21,7 +22,6 @@ const [registerModal, { openModal }] = useModal()
const [registerCreateBatchModal, { openModal: openCreateBatchModal }] = useModal()
const [registerHistoryModal, { openModal: openHistoryModal }] = useModal()
const [registerTable, { getForm, reload, getDataSource, updateTableDataRecord }] = useTable({
title: '测点列表',
api: getEXAPage,
@ -33,23 +33,19 @@ const [registerTable, { getForm, reload, getDataSource, updateTableDataRecord }]
schemas: searchFormSchema,
showResetButton: false,
actionColOptions: {
span: 2,
span: 6,
},
},
useSearchForm: true,
showTableSetting: true,
showIndexColumn: false,
actionColumn: {
width: 140,
width: 80,
title: t('common.action'),
dataIndex: 'action',
fixed: 'right',
},
})
// function handleQuery() {
// getForm().setFieldsValue({ condition: '' })
// reload()
// }
async function getNow() {
const params = getDataSource()
@ -109,6 +105,17 @@ async function handleDelete(record: Recordable) {
<template>
<div>
<BasicTable @register="registerTable">
<template #form-advanceBefore>
<Space style="margin-right: 10%;">
<a-button v-auth="['system:role:create']" type="primary" :pre-icon="IconEnum.ADD" @click="handleCreate">
{{ t('action.create') }}
</a-button>
<a-button v-auth="['system:role:create']" type="primary" :pre-icon="IconEnum.ADDS" @click="handleCreateBatch">
{{ t('action.createBatch') }}
</a-button>
</Space>
</template>
<template #value="{ record }">
<a class="click-status" @click="handleHistory(record)">
{{ record.value }}
@ -116,12 +123,12 @@ async function handleDelete(record: Recordable) {
<!-- <SlidersOutlined class="click-status" /> -->
</template>
<template #toolbar>
<a-button v-auth="['system:role:create']" type="primary" :pre-icon="IconEnum.ADD" @click="handleCreate">
<!-- <a-button v-auth="['system:role:create']" type="primary" :pre-icon="IconEnum.ADD" @click="handleCreate">
{{ t('action.create') }}
</a-button>
<a-button v-auth="['system:role:create']" type="primary" :pre-icon="IconEnum.ADDS" @click="handleCreateBatch">
{{ t('action.createBatch') }}
</a-button>
</a-button> -->
<!-- <a-button v-auth="['system:role:create']" :pre-icon="IconEnum.EXPORT" @click="handleExport">
{{ t('action.export') }}
</a-button> -->

9
src/views/exa/exa.data.ts

@ -6,7 +6,7 @@ export const columns: BasicColumn[] = [
{
title: '编号',
dataIndex: 'serialNumber',
width: 80,
width: 50,
},
{
title: '测点编码',
@ -16,12 +16,12 @@ export const columns: BasicColumn[] = [
{
title: '测点名称',
dataIndex: 'descriptor',
width: 200,
width: 170,
},
{
title: '实时值',
dataIndex: 'value',
width: 90,
width: 55,
className: 'value',
slots: { customRender: 'value' },
@ -29,7 +29,7 @@ export const columns: BasicColumn[] = [
{
title: '单位',
dataIndex: 'engUnits',
width: 30,
width: 35,
},
{
title: '组别',
@ -48,6 +48,7 @@ export const searchFormSchema: FormSchema[] = [
required: true,
colProps: { span: 8 },
},
]
export const formSchema: FormSchema[] = [

17
src/views/exa/history/PointModal.vue

@ -55,7 +55,7 @@ const [registerTable] = useTable({
schemas: searchFormSchema,
showResetButton: false,
actionColOptions: {
span: 2,
span: 3,
},
},
rowKey: 'serialNumber',
@ -109,7 +109,7 @@ const [registerSelectedTable] = useTable({
useSearchForm: false,
showIndexColumn: false,
actionColumn: {
width: 140,
width: 80,
title: t('common.action'),
dataIndex: 'action',
fixed: 'right',
@ -183,14 +183,15 @@ function onCanel() {
</script>
<template>
<BasicModal v-bind="$attrs" title="测点配置" width="1000px" @cancel="onCanel" @register="registerPointModal" @ok="handleOk">
<BasicModal v-bind="$attrs" :min-height="500" title="测点配置" width="850px" @cancel="onCanel" @register="registerPointModal" @ok="handleOk">
<BasicTable
ref="tableRef" :can-resize="false" title="RefTable示例" title-help-message="使用Ref调用表格内方法"
ref="tableRef" title="所有测点" :can-resize="false"
:row-selection="rowSelection" size="small" @register="registerTable"
/>
<BasicTable
ref="tableRef1" :pagination="false" size="small" :data-source="selectedData" :can-resize="false"
title="已选中测点" title-help-message="使用Ref调用表格内方法" @register="registerSelectedTable"
ref="tableRef1"
:pagination="false" size="small" :data-source="selectedData" :can-resize="false"
title="已选中测点" @register="registerSelectedTable"
>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
@ -221,3 +222,7 @@ function onCanel() {
</BasicTable>
</BasicModal>
</template>
<style>
</style>

2
src/views/exa/history/index.vue

@ -2,7 +2,7 @@
import { onMounted, reactive, ref } from 'vue'
import type { Dayjs } from 'dayjs'
import moment from 'moment'
import { Button, Card, Form, FormItem, RangePicker, Space, message } from 'ant-design-vue'
import { Button, Card, Empty, Form, FormItem, RangePicker, Space, message } from 'ant-design-vue'
import HistoryLine from '../HistoryLine.vue'
import PointModal from './PointModal.vue'
import { getExaHistorys } from '@/api/alert/exa'

11
src/views/run/instant/index.vue

@ -35,7 +35,7 @@ const [registerTable, { getForm, reload, getDataSource, updateTableDataRecord }]
schemas: searchFormSchema,
showResetButton: false,
actionColOptions: {
span: 2,
span: 3,
},
},
@ -141,6 +141,12 @@ function handleWarnConfig(record: Recordable) {
<template>
<div>
<BasicTable @register="registerTable">
<template #form-advanceBefore>
<a-button v-auth="['run:instant:create']" type="primary" :pre-icon="IconEnum.ADD" @click="handleCreate">
{{ t('action.create') }}
</a-button>
</template>
<template #detail="{ record }">
<a class="click-status" @click="handleDetail(record)">
{{ record.mpName }}
@ -178,9 +184,6 @@ function handleWarnConfig(record: Recordable) {
:class="countData?.stop === 0 ? 'runningStatus' : 'runningStatus alarm'" color="black" text="模型停运"
@click="getTableData('stop')"
/>
<a-button v-auth="['run:instant:create']" type="primary" :pre-icon="IconEnum.ADD" @click="handleCreate">
{{ t('action.create') }}
</a-button>
</template>
<template #runStatus="{ record }">
<div v-if="record.runningLog === '模式已停运'">

Loading…
Cancel
Save