lcw
This commit is contained in:
@ -273,8 +273,16 @@ const clone = (val) => {
|
||||
}
|
||||
watch(() => props.defaultData, (val) => {
|
||||
if (val) {
|
||||
|
||||
gzmc.value = val.gzmc
|
||||
dataList.value = list.filter(item => {
|
||||
if (val.sjlx) {
|
||||
return item.key != 'jqlx'
|
||||
}
|
||||
if (val.jqlx){
|
||||
return item.key != 'sjlx'
|
||||
}
|
||||
return item
|
||||
})
|
||||
const data = dataList.value.map(item => {
|
||||
switch (item.key) {
|
||||
case 'cs':
|
||||
@ -314,15 +322,7 @@ watch(() => props.defaultData, (val) => {
|
||||
}
|
||||
})
|
||||
copyList.value = data.filter(item => item[item.key] != null)
|
||||
dataList.value = list.filter(item => {
|
||||
if (val.sjlx) {
|
||||
return item.key != 'jqlx'
|
||||
}
|
||||
if (val.jqlx){
|
||||
return item.key != 'sjlx'
|
||||
}
|
||||
return item
|
||||
})
|
||||
|
||||
} else {
|
||||
dataList.value=list
|
||||
}
|
||||
|
||||
@ -41,7 +41,6 @@ const defaultData = ref({})
|
||||
const SSYJ = '02'
|
||||
const YJGZ='01'
|
||||
onMounted(() => {
|
||||
|
||||
switch (props.item.mxlx) {
|
||||
case SSYJ:
|
||||
getmxglSsyjpzSelectList()
|
||||
@ -104,7 +103,8 @@ const addSsyj = () => {
|
||||
ElMessage.warning('请填写规则名称')
|
||||
return
|
||||
}
|
||||
if (!defaultData.value) {
|
||||
|
||||
if (!defaultData.value.id) {
|
||||
const promes = {
|
||||
mxid: props.item.id,
|
||||
...data
|
||||
@ -139,7 +139,10 @@ const addYjgzpzs = () => {
|
||||
ElMessage.warning('请事件类型和警情类型必须选择一个')
|
||||
return
|
||||
}
|
||||
if (!defaultData.value) {
|
||||
|
||||
|
||||
if (!defaultData.value.id) {
|
||||
console.log(props.item.id,"xxxxxxxxx");
|
||||
const promes = {
|
||||
mxid:props.item.id,
|
||||
...data
|
||||
@ -152,8 +155,6 @@ const addYjgzpzs = () => {
|
||||
ElMessage.error(err.message)
|
||||
});
|
||||
} else {
|
||||
console.log( defaultData.value.id);
|
||||
|
||||
editYjgzpz({
|
||||
id: defaultData.value.id,
|
||||
...data
|
||||
|
||||
@ -19,25 +19,33 @@
|
||||
<strong>模型名称:</strong>{{ it.mxmc }}
|
||||
</div>
|
||||
<div class="model-type flex">
|
||||
<strong>模型类型:</strong> <DictTag :tag="false" :value="it.mxlx" :options="D_MXGL_MXLX" />
|
||||
<strong>模型类型:</strong>
|
||||
<DictTag :tag="false" :value="it.mxlx" :options="D_MXGL_MXLX" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="model-image-container" @click="openYjList(it)">
|
||||
<img class="model-image"
|
||||
src="@/assets/images/mxbg.jpg" alt="">
|
||||
<img class="model-image" src="@/assets/images/mxbg.jpg" alt="">
|
||||
</div>
|
||||
<div class="model-actions">
|
||||
<span class="action-btn action-btn-view" @click.stop="openAddRule('', it)">
|
||||
<el-icon class="action-icon"><Document /></el-icon>查看规则
|
||||
<el-icon class="action-icon">
|
||||
<Document />
|
||||
</el-icon>查看规则
|
||||
</span>
|
||||
<span class="action-btn action-btn-edit" @click.stop="openAddModel('edit', it)">
|
||||
<el-icon class="action-icon"><ChatDotSquare /></el-icon>编辑
|
||||
<el-icon class="action-icon">
|
||||
<ChatDotSquare />
|
||||
</el-icon>编辑
|
||||
</span>
|
||||
<span class="action-btn action-btn-edit" @click.stop="openAddModel('detail', it)">
|
||||
<el-icon class="action-icon"><Edit /></el-icon>详情
|
||||
<span class="action-btn action-btn-edit" @click.stop="operationRule(it)">
|
||||
<el-icon class="action-icon">
|
||||
<Edit />
|
||||
</el-icon>执行
|
||||
</span>
|
||||
<span class="action-btn action-btn-delete" @click.stop="delDictItem(it.id)">
|
||||
<el-icon class="action-icon"><Files /></el-icon>删除
|
||||
<el-icon class="action-icon">
|
||||
<Files />
|
||||
</el-icon>删除
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
@ -53,7 +61,7 @@
|
||||
|
||||
<script setup>
|
||||
import PageTitle from "@/components/aboutTable/PageTitle.vue";
|
||||
import { getPageList, deleteEntity } from '@/api/model.js'
|
||||
import { getPageList, deleteEntity, getSsyjpzMxgzxl, SsyjselectList, getYjgzpzSelectList, getYjgzpzMxgzxl } from '@/api/model.js'
|
||||
import emitter from "@/utils/eventBus.js";
|
||||
import { CirclePlus } from '@element-plus/icons-vue'
|
||||
import * as MOSTY from "@/components/MyComponents/index";
|
||||
@ -62,12 +70,12 @@ import { reactive, ref, onMounted, getCurrentInstance, watch, defineEmits } from
|
||||
import AddModel from "../components/AddModel/addModel";
|
||||
const emit = defineEmits(['change'])
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { D_MXGL_MXLX ,D_BZ_RYBQ} = proxy.$dict("D_MXGL_MXLX","D_BZ_RYBQ")
|
||||
const { D_MXGL_MXLX, D_BZ_RYBQ } = proxy.$dict("D_MXGL_MXLX", "D_BZ_RYBQ")
|
||||
const searchBox = ref(); //搜索框
|
||||
const show = ref(false)
|
||||
const listHeight = ref()
|
||||
const SSYJ = '02'
|
||||
const YJGZ='01'
|
||||
const YJGZ = '01'
|
||||
const searchConfiger = ref([
|
||||
{ label: "模型名称", prop: "mxmc", placeholder: "请输入模型名称", showType: "input" },
|
||||
{
|
||||
@ -156,18 +164,56 @@ const openAddModel = (type, row) => {
|
||||
const openAddRule = (type, row) => {
|
||||
switch (row.mxlx) {
|
||||
case SSYJ:
|
||||
emitter.emit('changeModel', {row,name:'四色预警规则'})
|
||||
emitter.emit('changeModel', { row, name: '四色预警规则' })
|
||||
break;
|
||||
case YJGZ:
|
||||
emitter.emit('changeModel', {row,name:'预警规则'})
|
||||
case YJGZ:
|
||||
emitter.emit('changeModel', { row, name: '预警规则' })
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
const openYjList = (row) => {
|
||||
emitter.emit('changeModel', {row,name:'预警列表'})
|
||||
emitter.emit('changeModel', { row, name: '预警列表' })
|
||||
}
|
||||
const operationRule = async (row) => {
|
||||
if (row.mxlx == SSYJ) {
|
||||
try {
|
||||
const data = await SsyjselectList({ mxid: row.id })
|
||||
if (data.length > 0) {
|
||||
await getSsyjpzMxgzxl({ id: data[0].id })
|
||||
proxy.$message.success('运行成功')
|
||||
} else {
|
||||
proxy.$message.warning('未配置预警规则')
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
proxy.$message.error('运行失败')
|
||||
}
|
||||
}
|
||||
if (row.mxlx == YJGZ) {
|
||||
try {
|
||||
const data = await getYjgzpzSelectList({ mxid: row.id })
|
||||
if (data.length > 0) {
|
||||
await getYjgzpzMxgzxl({ id: data[0].id })
|
||||
proxy.$message.success('运行成功')
|
||||
} else {
|
||||
proxy.$message.warning('未配置预警规则')
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
|
||||
proxy.$message.error('运行失败')
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Reference in New Issue
Block a user