指标字典
This commit is contained in:
@@ -107,7 +107,7 @@ export namespace Dict {
|
|||||||
unit?: string | null;//单位
|
unit?: string | null;//单位
|
||||||
harmStart?:number | null;//起始次数
|
harmStart?:number | null;//起始次数
|
||||||
harmEnd?:number | null;//结束次数
|
harmEnd?:number | null;//结束次数
|
||||||
classId?: string | null;//数据表表名
|
classId: string ;//数据表表名
|
||||||
statMethod?:string;//数据统计类型(最大、最小、平均、CP95)
|
statMethod?:string;//数据统计类型(最大、最小、平均、CP95)
|
||||||
systemType?:string | null;//系统类别(区分用能/电能)
|
systemType?:string | null;//系统类别(区分用能/电能)
|
||||||
tranFlag?:number ;//数据是否上送(0:不上送 1:上送)
|
tranFlag?:number ;//数据是否上送(0:不上送 1:上送)
|
||||||
@@ -116,10 +116,10 @@ export namespace Dict {
|
|||||||
storeFlag?:string ;//sts、di的是否存储 1:存储 0:不存 储;
|
storeFlag?:string ;//sts、di的是否存储 1:存储 0:不存 储;
|
||||||
curSts?:number | null;//sts、do的当前值;
|
curSts?:number | null;//sts、do的当前值;
|
||||||
ctlSts?:number;//do的是否可远程控制 1:是 0:否;
|
ctlSts?:number;//do的是否可远程控制 1:是 0:否;
|
||||||
maxNum?:number | null;//设置最大值
|
maxNum?:number ;//设置最大值
|
||||||
minNum?: number | null;//设置最小值
|
minNum?: number;//设置最小值
|
||||||
setValue?:string | null;//参数为enum可设置的所有值序列
|
setValue?:string | null;//参数为enum可设置的所有值序列
|
||||||
strlen?:number | null;//参数string可设置字符串的长度上 限
|
strlen?:number ;//参数string可设置字符串的长度上 限
|
||||||
defaultValue?:string | null; //参数缺省值、告警code值
|
defaultValue?:string | null; //参数缺省值、告警code值
|
||||||
resourcesId?:string ; //报表数据来源(统计表表名)
|
resourcesId?:string ; //报表数据来源(统计表表名)
|
||||||
limitName?:string | null; //限值字段名称
|
limitName?:string | null; //限值字段名称
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Login } from './interface'
|
import type { Login } from './interface'
|
||||||
import { ADMIN as rePrefix } from '@/api/config/serviceName'
|
import { ADMIN as rePrefix } from '@/api/config/serviceName'
|
||||||
import http from '@/api'
|
import http from '@/api'
|
||||||
import type { Dict } from '../interface'
|
import type { Dict } from '../interface'
|
||||||
|
|||||||
@@ -4,12 +4,12 @@ import piniaPersistConfig from '@/stores/helper/persist'
|
|||||||
import { DICT_STORE_KEY } from '@/stores/constant'
|
import { DICT_STORE_KEY } from '@/stores/constant'
|
||||||
// 模拟数据
|
// 模拟数据
|
||||||
//import dictData from '@/api/system/dictData'
|
//import dictData from '@/api/system/dictData'
|
||||||
import { getDictList } from '@/api/user/login.ts'
|
|
||||||
|
|
||||||
export const useDictStore = defineStore({
|
export const useDictStore = defineStore({
|
||||||
id: DICT_STORE_KEY,
|
id: DICT_STORE_KEY,
|
||||||
state: () => ({
|
state: () => ({
|
||||||
dictData: [],
|
dictData: [] as Dict[],
|
||||||
}),
|
}),
|
||||||
getters: {},
|
getters: {},
|
||||||
actions: {
|
actions: {
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ import { ElMessage } from "element-plus";
|
|||||||
import { useAuthStore } from "@/stores/modules/auth";
|
import { useAuthStore } from "@/stores/modules/auth";
|
||||||
import model from "./tabs/model.vue";
|
import model from "./tabs/model.vue";
|
||||||
import dashboard from "./tabs/dashboard.vue";
|
import dashboard from "./tabs/dashboard.vue";
|
||||||
|
import { onMounted } from "vue";
|
||||||
const authStore = useAuthStore();
|
const authStore = useAuthStore();
|
||||||
console.log(authStore.showMenuFlagGet, "????????????????33333333");
|
console.log(authStore.showMenuFlagGet, "????????????????33333333");
|
||||||
const activeIndex = ref("1-1");
|
const activeIndex = ref("1-1");
|
||||||
|
|||||||
@@ -56,7 +56,7 @@
|
|||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import { HOME_URL } from '@/config'
|
import { HOME_URL } from '@/config'
|
||||||
import { getTimeState } from '@/utils'
|
import { getTimeState } from '@/utils'
|
||||||
import { Dict, Login } from '@/api/interface'
|
import { type Dict, Login } from '@/api/interface'
|
||||||
import { ElNotification } from 'element-plus'
|
import { ElNotification } from 'element-plus'
|
||||||
import { getDictList, loginApi } from '@/api/user/login'
|
import { getDictList, loginApi } from '@/api/user/login'
|
||||||
import { useUserStore } from '@/stores/modules/user'
|
import { useUserStore } from '@/stores/modules/user'
|
||||||
@@ -74,6 +74,7 @@ const userStore = useUserStore()
|
|||||||
const tabsStore = useTabsStore()
|
const tabsStore = useTabsStore()
|
||||||
const keepAliveStore = useKeepAliveStore()
|
const keepAliveStore = useKeepAliveStore()
|
||||||
import { useDictStore } from '@/stores/modules/dict'
|
import { useDictStore } from '@/stores/modules/dict'
|
||||||
|
import { onMounted } from 'vue'
|
||||||
|
|
||||||
const dictStore = useDictStore()
|
const dictStore = useDictStore()
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<el-option
|
<el-option
|
||||||
v-for="item in dictStore.getDictData('High_Cate')"
|
v-for="item in dictStore.getDictData('High_Cate')"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:name="item.name"
|
:label="item.name"
|
||||||
:value="item.code"
|
:value="item.code"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
@@ -50,12 +50,13 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label='数据统计类型' :label-width='140' prop='statMethod'>
|
<el-form-item label='数据统计类型' :label-width='140' prop='statMethod'>
|
||||||
|
|
||||||
<el-select v-model="formContent.statMethod" multiple placeholder="请选择数据统计类型">
|
<el-select v-model="formContent.statMethod" multiple placeholder="请选择数据统计类型">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in options"
|
v-for="item in dictStore.getDictData('statMethod')"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
:name="item.label"
|
:name="item.name"
|
||||||
:value="item.value"
|
:value="item.code"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -72,10 +73,10 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label='数据表表名' :label-width='140' prop='statMethod'>
|
<el-form-item label='数据表表名' :label-width='140' prop='classId'>
|
||||||
<el-select v-model="formContent.statMethod" clearable placeholder="请选择数据表表名">
|
<el-select v-model="formContent.classId" clearable placeholder="请选择数据表表名">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in dictStore.getDictData('statMethod')"
|
v-for="item in dictStore.getDictData('classId')"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:name="item.name"
|
:name="item.name"
|
||||||
:value="item.code"
|
:value="item.code"
|
||||||
@@ -99,7 +100,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label='排序' :label-width='140'>
|
<el-form-item label='排序' :label-width='140'>
|
||||||
<el-input-number v-model='formContent.sort' />
|
<el-input-number v-model='formContent.sort' :min="0" controls-position="right" style="width: 300px;"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-divider >拓展数据</el-divider>
|
<el-divider >拓展数据</el-divider>
|
||||||
<el-form-item label='参数缺省值' :label-width='140' prop='defaultValue'>
|
<el-form-item label='参数缺省值' :label-width='140' prop='defaultValue'>
|
||||||
@@ -109,16 +110,16 @@
|
|||||||
<el-input v-model='formContent.eventType' placeholder='请输入事件类别' autocomplete='off' />
|
<el-input v-model='formContent.eventType' placeholder='请输入事件类别' autocomplete='off' />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label='设置最大值' :label-width='140' prop='maxNum'>
|
<el-form-item label='设置最大值' :label-width='140' prop='maxNum'>
|
||||||
<el-input v-model='formContent.maxNum' placeholder='请输入最大值' autocomplete='off' />
|
<el-input-number v-model='formContent.maxNum' controls-position="right" style="width: 300px;"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label='设置最小值' :label-width='140' prop='minNum'>
|
<el-form-item label='设置最小值' :label-width='140' prop='minNum'>
|
||||||
<el-input v-model='formContent.minNum' placeholder='请输入最小值' autocomplete='off' />
|
<el-input-number v-model='formContent.minNum' controls-position="right" style="width: 300px;"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label='枚举序列' :label-width='140' prop='setValue'>
|
<el-form-item label='枚举序列' :label-width='140' prop='setValue'>
|
||||||
<el-input v-model='formContent.setValue' placeholder='请输入枚举序列' autocomplete='off' />
|
<el-input v-model='formContent.setValue' placeholder='请输入枚举序列' autocomplete='off' />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label='字符串长度上限' :label-width='140' prop='strlen'>
|
<el-form-item label='字符串长度上限' :label-width='140' prop='strlen'>
|
||||||
<el-input v-model='formContent.strlen' placeholder='请输入字符串长度上限' autocomplete='off' />
|
<el-input-number v-model='formContent.strlen' controls-position="right" style="width: 300px;"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label='上送规则' :label-width='140' prop='tranRule'>
|
<el-form-item label='上送规则' :label-width='140' prop='tranRule'>
|
||||||
<el-input v-model='formContent.tranRule' placeholder='请输入上送规则' autocomplete='off' />
|
<el-input v-model='formContent.tranRule' placeholder='请输入上送规则' autocomplete='off' />
|
||||||
@@ -131,20 +132,20 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="是否可远程控制" :label-width="140">
|
<el-form-item label="是否可远程控制" :label-width="140">
|
||||||
<el-radio-group v-model="formContent.ctlSts" >
|
<el-radio-group v-model="formContent.ctlSts" >
|
||||||
<el-radio-button label="是" :value="1"></el-radio-button>
|
<el-radio label="是" :value="1"></el-radio>
|
||||||
<el-radio-button label="否" :value="0"></el-radio-button>
|
<el-radio label="否" :value="0"></el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="是否存储" :label-width="140">
|
<el-form-item label="是否存储" :label-width="140">
|
||||||
<el-radio-group v-model="formContent.storeFlag" >
|
<el-radio-group v-model="formContent.storeFlag" >
|
||||||
<el-radio-button label="是" :value="1"></el-radio-button>
|
<el-radio label="是" :value="1"></el-radio>
|
||||||
<el-radio-button label="否" :value="0"></el-radio-button>
|
<el-radio label="否" :value="0"></el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="数据是否上送" :label-width="140">
|
<el-form-item label="数据是否上送" :label-width="140">
|
||||||
<el-radio-group v-model="formContent.tranFlag" >
|
<el-radio-group v-model="formContent.tranFlag" >
|
||||||
<el-radio-button label="是" :value="1"></el-radio-button>
|
<el-radio label="是" :value="1"></el-radio>
|
||||||
<el-radio-button label="否" :value="0"></el-radio-button>
|
<el-radio label="否" :value="0"></el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
@@ -167,34 +168,10 @@
|
|||||||
import { addDictPq, updateDictPq } from '@/api/system/dictionary/dictPq'
|
import { addDictPq, updateDictPq } from '@/api/system/dictionary/dictPq'
|
||||||
import { computed, type Ref, ref } from 'vue';
|
import { computed, type Ref, ref } from 'vue';
|
||||||
import { useDictStore } from '@/stores/modules/dict'
|
import { useDictStore } from '@/stores/modules/dict'
|
||||||
import { getDictList } from '@/api/user/login.ts'
|
|
||||||
const dictStore = useDictStore()
|
const dictStore = useDictStore()
|
||||||
|
|
||||||
// 定义弹出组件元信息
|
// 定义弹出组件元信息
|
||||||
const dialogFormRef = ref()
|
const dialogFormRef = ref()
|
||||||
const options = [
|
|
||||||
{
|
|
||||||
value: 'Option1',
|
|
||||||
label: 'Option1',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 'Option2',
|
|
||||||
label: 'Option2',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 'Option3',
|
|
||||||
label: 'Option3',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 'Option4',
|
|
||||||
label: 'Option4',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 'Option5',
|
|
||||||
label: 'Option5',
|
|
||||||
},
|
|
||||||
]
|
|
||||||
|
|
||||||
function useMetaInfo() {
|
function useMetaInfo() {
|
||||||
const dialogVisible = ref(false)
|
const dialogVisible = ref(false)
|
||||||
const titleType = ref('add')
|
const titleType = ref('add')
|
||||||
@@ -205,7 +182,7 @@ import { getDictList } from '@/api/user/login.ts'
|
|||||||
sort: 100,
|
sort: 100,
|
||||||
dataType: '',
|
dataType: '',
|
||||||
state: 1,
|
state: 1,
|
||||||
|
classId: '',
|
||||||
})
|
})
|
||||||
return { dialogVisible, titleType, formContent }
|
return { dialogVisible, titleType, formContent }
|
||||||
}
|
}
|
||||||
@@ -220,7 +197,7 @@ import { getDictList } from '@/api/user/login.ts'
|
|||||||
sort: 100,
|
sort: 100,
|
||||||
dataType: '',
|
dataType: '',
|
||||||
state: 1,
|
state: 1,
|
||||||
|
classId: '',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -233,6 +210,7 @@ import { getDictList } from '@/api/user/login.ts'
|
|||||||
dataType: [{ required: true, message: '数据模型必选!', trigger: 'change' }],
|
dataType: [{ required: true, message: '数据模型必选!', trigger: 'change' }],
|
||||||
name: [{ required: true, message: '指标名称必填!', trigger: 'blur' }],
|
name: [{ required: true, message: '指标名称必填!', trigger: 'blur' }],
|
||||||
phase: [{ required: true, message: '相别必选!', trigger: 'change' }],
|
phase: [{ required: true, message: '相别必选!', trigger: 'change' }],
|
||||||
|
classId: [{ required: true, message: '数据库表名必选!', trigger: 'change' }],
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
@@ -250,6 +228,7 @@ import { getDictList } from '@/api/user/login.ts'
|
|||||||
try {
|
try {
|
||||||
dialogFormRef.value?.validate(async (valid: boolean) => {
|
dialogFormRef.value?.validate(async (valid: boolean) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
|
||||||
if (formContent.value.id) {
|
if (formContent.value.id) {
|
||||||
await updateDictPq(formContent.value)
|
await updateDictPq(formContent.value)
|
||||||
} else {
|
} else {
|
||||||
@@ -270,7 +249,7 @@ import { getDictList } from '@/api/user/login.ts'
|
|||||||
const open = (sign: string, data: Dict.ResDictPq) => {
|
const open = (sign: string, data: Dict.ResDictPq) => {
|
||||||
titleType.value = sign
|
titleType.value = sign
|
||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
console.log('123456',dictStore.getDictData('High_Cate'))
|
console.log('123456',dictStore)
|
||||||
if (data.id) {
|
if (data.id) {
|
||||||
formContent.value = { ...data }
|
formContent.value = { ...data }
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
<script setup lang='tsx' name='dict'>
|
<script setup lang='tsx' name='dict'>
|
||||||
import {CirclePlus, Delete, EditPen, Download, View} from '@element-plus/icons-vue'
|
import {CirclePlus, Delete, EditPen, Download, View} from '@element-plus/icons-vue'
|
||||||
import {Dict} from '@/api/system/dictionary/interface'
|
import {type Dict} from '@/api/system/dictionary/interface'
|
||||||
import {ProTableInstance, ColumnProps} from '@/components/ProTable/interface'
|
import {ProTableInstance, ColumnProps} from '@/components/ProTable/interface'
|
||||||
import PqPopup from '@/views/system/dictionary/dictPq/components/pqPopup.vue'
|
import PqPopup from '@/views/system/dictionary/dictPq/components/pqPopup.vue'
|
||||||
import {useDictStore} from '@/stores/modules/dict'
|
import {useDictStore} from '@/stores/modules/dict'
|
||||||
@@ -50,9 +50,9 @@
|
|||||||
prop: 'dataType',
|
prop: 'dataType',
|
||||||
label: '数据模型',
|
label: '数据模型',
|
||||||
width: 180,
|
width: 180,
|
||||||
search: {
|
enum: dictStore.getDictData('High_Cate'),
|
||||||
el: 'select',
|
search: { el: 'select', props: { filterable: true } },
|
||||||
},
|
fieldNames: { label: 'name', value: 'code' },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'name',
|
prop: 'name',
|
||||||
|
|||||||
Reference in New Issue
Block a user