This commit is contained in:
lcw
2025-09-24 18:10:41 +08:00
parent 63cd5ba2a3
commit 16d05358d1
178 changed files with 5957 additions and 1293 deletions

View File

@ -0,0 +1,105 @@
<template>
<div class="dialog" v-if="dialogForm">
<div class="head_box">
<span class="title">{{ title }}模型 </span>
<div>
<el-button type="primary" size="small" :loading="loading" @click="submit" v-show="title != '详情'">保存</el-button>
<el-button size="small" @click="close">关闭</el-button>
</div>
</div>
<div class="form_cnt">
<FormMessage :formList="formData" v-model="listQuery" ref="elform" :rules="rules" :disabled="editAdd">
</FormMessage>
</div>
</div>
</template>
<script setup>
import { reactive, ref, getCurrentInstance } from 'vue'
import FormMessage from "@/components/aboutTable/FormMessage.vue";
import { addEntity,editEntity } from '@/api/model.js'
import { ElMessage } from "element-plus";
const proxy = getCurrentInstance()
const props = defineProps({
dict: {
type: Array,
default: () => [],
}
})
const dialogForm = ref(false)
const emit = defineEmits(['getLits'])
// 判断是否增删改
const editAdd = ref(false)
const title = ref("新增")
const formData = ref()
const listQuery = ref({})
const elform = ref()
const rules = ref({
mxmc: [
{ required: true, message: '请输入模型名称', trigger: 'blur' },
],
mxlx: [
{ required: true, message: '请选择模型类型', trigger: 'change' },
],
})
const init = (type, row) => {
dialogForm.value = true
editAdd.value = false
formData.value = [
{ label: "模型名称", prop: "mxmc", type: "input", width: "40%" },
{
label: "模型类型", prop: "mxlx", type: "select",
width: "40%", options: props.dict.D_MXGL_MXLX
},
]
listQuery.value = { ...row }
if (type == 'edit') {
title.value = "编辑"
} else if (type == 'add') {
title.value = "新增"
} else {
editAdd.value = true
title.value = "详情"
}
}
// 表单内容
const loading = ref(false)
// 新增
const submit = () => {
elform.value.submit((data) => {
loading.value = true
if (title.value == '新增') {
addEntity(listQuery.value).then((res) => {
ElMessage.success("新增成功");
emit('getLits')
dialogForm.value = false
}).catch((err) => {
console.log(err);
}).finally(() => {
loading.value = false
});
} else {
editEntity(listQuery.value).then((res) => {
ElMessage.success("修改成功");
emit('getLits')
dialogForm.value = false
}).finally(() => {
loading.value = false
});
}
})
}
// 关闭
const close = () => {
dialogForm.value = false
}
defineExpose({
init
})
</script>
<style lang="scss" scoped></style>

View File

@ -0,0 +1,201 @@
<template>
<div>
<div class="titleBox">
<PageTitle title="预警列表">
<!-- <el-button type="primary" size="small" @click="yzSsyjpzMxgzxl()">测试</el-button> -->
<el-button size="small" @click="retenHome()">返回</el-button>
</PageTitle>
</div>
<!-- 搜索 -->
<div ref="searchBox">
<Search :searchArr="searchConfiger" @submit="onSearch" />
</div>
<!-- 表格 -->
<div class="tabBox">
<MyTable :tableData="pageData.tableData" :tableColumn="pageData.tableColumn" :tableHeight="pageData.tableHeight"
:key="pageData.keyCount" :tableConfiger="pageData.tableConfiger" :controlsWidth="pageData.controlsWidth"
>
<template #yjlx="{ row }">
<DictTag :tag="false" :value="row.yjlx" :options="dict.D_BZ_TPYJLX" />
</template>
<template #controls="{ row }">
<el-link type="primary" size="small" @click="opneModel">打开研判报告</el-link>
<el-link type="primary" size="small" @click="openYjdict(row)">详情</el-link>
</template>
</MyTable>
<Pages @changeNo="changeNo" @changeSize="changeSize" :tableHeight="pageData.tableHeight" :pageConfiger="{
...pageData.pageConfiger,
total: pageData.total
}"></Pages>
</div>
</div>
<YpModel v-model="showModel" @SaveReport="SaveReport" :heightNumber="436" v-model:textContent="textContent"></YpModel>
<Yjdict ref="yjdict" :dict="dict"/>
</template>
<script setup>
import YpModel from '@/components/ypModel/index.vue'
import emitter from "@/utils/eventBus.js";
import { getYjxxPageList,getSsyjpzMxgzxl } from "@/api/model";
import PageTitle from "@/components/aboutTable/PageTitle.vue";
import MyTable from "@/components/aboutTable/MyTable.vue";
import Pages from "@/components/aboutTable/Pages.vue";
import Search from "@/components/aboutTable/Search.vue";
import {timeValidate} from '@/utils/tools'
import { reactive, ref, onMounted, getCurrentInstance, watch } from "vue";
import { textStyle, Firstlevelheading, Subheading, BiheadlinegTitle, newTotitle,BigTitle,fbtool, headTitle, report, signature } from '../content.js'
import Yjdict from './yjdict.vue'
const props = defineProps({
item: {
type: Object,
default: () => ({})
}, dict: {
type: Object,
default: () => ({})
}
})
const queryFrom = ref({})
const searchBox = ref(); //搜索框
const yjdict = ref(null)//详情弹窗
const ItemData=ref()//模型数据
const showModel = ref(false)
const textContent=ref('')//报告数据
const SaveReport = () => {
}
const opneModel = () => {
showModel.value = true
textContent.value=''
textContent.value += BigTitle("林芝市公安局情指中心") + BigTitle("研判专刊(初稿)") + newTotitle({
org: "市公安局情指中心编",
time: timeValidate()
})+fbtool('同类事件发生3次以上预警')+textStyle("2025年9月2日164525,产生同类事件3次以上预警,刑事案件中的置充身份诈美发生3起同七上升30%、环比比下健5%")
+ Subheading('1.警情内容') + Subheading('2.警情内容') + Subheading('3.警情内容')
}
const searchConfiger = ref([
{
label: "时间",
prop: "startTime",
placeholder: "请选择时间",
showType: "daterange"
},
]);
const pageData = reactive({
tableData: [],
keyCount: 0,
tableConfiger: {
rowHieght: 61,
showSelectType: "null",
loading: false
},
total: 0,
pageConfiger: {
pageSize: 20,
pageCurrent: 1
},
controlsWidth: 300,
tableColumn: [
{ label: "预警时间", prop: "yjsj", showOverflowTooltip: true },
{ label: "类型", prop: "yjlx" ,showSolt:true },
{ label: "内容", prop: "yjnr", showOverflowTooltip: true},
// ypbg
]
});
onMounted(() => {
getList();
tabHeightFn();
});
const openYjdict = (val) => {
yjdict.value.init(val)
}
watch(() => props.item, (val) => {
ItemData.value=val
},{deep:true})
// 获取列表
const getList = () => {
const promes = {
...pageData.pageConfiger,
...queryFrom.value,
mxid:props.item.id,
}
getYjxxPageList(promes).then((res) => {
pageData.tableData = res.records
pageData.total = res.total
});
};
// 搜索
const onSearch = (val) => {
queryFrom.value.startTime = val.startTime&&val.startTime.length > 0 ? val.startTime[0] : '';
queryFrom.value.endTime = val.startTime&&val.startTime.length > 0 ? val.startTime[1] : '';
pageData.pageConfiger.pageCurrent = 1;
getList();
};
const changeNo = (val) => {
pageData.pageConfiger.pageCurrent = val;
getList();
};
const changeSize = (val) => {
pageData.pageConfiger.pageSize = val;
getList();
};
//返回
const retenHome = () => {
emitter.emit('changeModel', { name: '研判首页', row: {} });
}
// 表格高度计算
const tabHeightFn = () => {
pageData.tableHeight = window.innerHeight - searchBox.value.offsetHeight - 250;
window.onresize = function () {
tabHeightFn();
};
};
// 测试
const yzSsyjpzMxgzxl = (params) => {
// getYjgzpzMxgzxl({id:'26aefb9f4c7c41b3a4bfb5b68449328b'}).then((res) => {
// })
getSsyjpzMxgzxl({id:'88c166e670da48e59324906648794b05'}).then((res) => {
})
}
</script>
<style lang="scss" scoped>
.checkbox-group {
display: flex;
gap: 20px;
}
.basic-info {
display: flex;
gap: 15px;
.avatar {
width: 80px;
height: 80px;
overflow: hidden;
border-radius: 4px;
img {
width: 100%;
height: 100%;
object-fit: cover;
}
}
.info-list {
display: flex;
flex-direction: column;
gap: 5px;
}
}
.control-buttons {
display: flex;
gap: 10px;
}
</style>

View File

@ -0,0 +1,75 @@
<template>
<div class="dialog" v-if="dialogForm">
<div class="head_box">
<div>详情</div>
<div><el-button @click="close">关闭</el-button></div>
</div>
<div class="form_cnt">
<FormMessage v-model="listQuery" disabled :formList="formData" ref="elform" />
</div>
</div>
</template>
<script setup>
import FormMessage from "@/components/aboutTable/FormMessage.vue";
import { ref, defineExpose} from "vue";
const props = defineProps({
dict: {
type: Object,
default: () => ({})
}
});
const dialogForm = ref(false); //弹窗
const formData = ref([
{ label: "预警内容", prop: "yjnr", type: "textarea" ,width:'100%'},
{ label: "预警时间", prop: "yjsj", type: "date" },
{ label: "预警类型", prop: "yjlx", type: "select", options: props.dict.D_BZ_TPYJLX },
]);
const listQuery = ref({}); //表单
const elform = ref();
// 初始化数据
const init = (row) => {
dialogForm.value = true;
listQuery.value = row;
};
// 关闭
const close = () => {
listQuery.value = {};
dialogForm.value = false;
};
defineExpose({ init });
</script>
<style lang="scss" scoped>
@import "~@/assets/css/layout.scss";
@import "~@/assets/css/element-plus.scss";
::v-deep .el-tabs--card>.el-tabs__header .el-tabs__item.is-active {
color: #0072ff;
background: rgba(0, 114, 255, 0.3);
}
.boxlist {
width: 99%;
height: 225px;
margin-top: 10px;
overflow: hidden;
}
::v-deep .avatar-uploader {
display: flex;
align-items: center;
}
::v-deep .el-upload-list {
margin-left: 20px;
display: flex;
align-items: center;
}
::v-deep .el-upload-list__item-name .el-icon {
top: 3px;
}
</style>

View File

@ -0,0 +1,739 @@
<template>
<!-- 可用条件类型列表 -->
<div class="regulation-wrapper">
<div class="rule-name-section flex align-center">
<div class="rule-name-label">规则名称</div>
<el-input v-model="gzmc" :disabled="disabled" placeholder="请输入规则名称" class="search-input" clearable></el-input>
</div>
<!-- 可用条件区域 -->
<div class="condition-section">
<div class="available-conditions">
<VueDraggable class="flex-wrap" v-model="dataList" ghostClass="ghost"
:group="{ name: 'people', pull: 'clone', put: false }" :clone="clone">
<el-button v-for="item in dataList" :key="item.name" class="condition-button" size="small">
<i class="el-icon-document-add"></i>
{{ item.name }}
</el-button>
</VueDraggable>
</div>
</div>
<!-- 拖拽提示 -->
<div class="drag-hint">
<i class="el-icon-arrow-down"></i>
<span>拖拽条件到下方区域<span style="color: red;">(事件类型和警情类型必须选择一个)</span></span>
</div>
<!-- 已选条件区域 -->
<div class="selected-section">
<div class="section-title">
<i class="el-icon-check-square"></i>
<span>已选条件</span>
<span class="selected-count">{{ copyList.length }}</span>
</div>
<div class="selected-container">
<VueDraggable v-model="copyList" :group="{ name: 'people', pull: !disabled, put: !disabled }" ghostClass="ghost"
class="selected-list" itemKey="name">
<div v-for="(item, indexs) in copyList" :key="item" class="draggable-item">
<div class="item-content">
<div v-if="!disabled" class="item-remove-btn" @click="romes(item)"><el-icon :size="16">
<Close />
</el-icon></div>
<span class="item-text">{{ item.name }}{{}}</span>
</div>
<div v-if="item[item['key']]">
<template v-if="item.key == 'dd'">
<div class="condition-input-container flex just-between" v-for="(value, index) in item[item['key']]">
<div>
<el-input v-model="item[item['key']][index]" :placeholder="`请输入${item.name}`" clearable></el-input>
</div>
<div>
<el-button class="btn-margin-right" v-if="index == item[item['key']].length - 1"
@click="addInput(item['key'], indexs)" type="danger" size="mini">+</el-button>
<el-button class="btn-margin-right" v-if="index != item[item['key']].length - 1"
@click="removeItem(item['key'], index)" type="danger" size="mini">-</el-button>
</div>
</div>
</template>
<template v-if="item.key == 'cs'">
<div class="count-condition-container">
<el-select v-model="item[item['key']].tj" placeholder="请选择条件" class="condition-select">
<el-option :label="item" :value="item" v-for="(item, index) in dataConst" :key="index"></el-option>
</el-select>
<el-input-number v-model="item[item['key']].cs" :min="1" :max="1000" />
</div>
</template>
<template v-if="item.key == 'zz'">
<div class="condition-input-container flex just-between" v-for="(value, index) in item[item['key']]">
<div>
<el-input v-model="item[item['key']][index]" :placeholder="`请输入${item.name}`" clearable></el-input>
</div>
<div>
<el-button class="btn-margin-right" v-if="index == item[item['key']].length - 1"
@click="addInput(item['key'], indexs)" type="danger" size="mini">+</el-button>
<el-button class="btn-margin-right" v-if="index != item[item['key']].length - 1"
@click="removeItem(item['key'], index)" type="danger" size="mini">-</el-button>
</div>
</div>
</template>
<template v-if="item.key == 'kssj'">
<div class="condition-input-container flex just-between">
<div>
<el-date-picker value-format="YYYY-MM-DD" format="YYYY-MM-DD" v-model="item[item['key']]"
type="date" :placeholder="`请选择${item.name}`" />
</div>
</div>
</template>
<template v-if="item.key == 'jssj'">
<div class="condition-input-container flex just-between">
<div>
<el-date-picker value-format="YYYY-MM-DD" format="YYYY-MM-DD" v-model="item[item['key']]"
type="date" :placeholder="`请选择${item.name}`" />
</div>
</div>
</template>
<template v-if="item.key == 'sjlx'">
<div class="condition-input-container flex just-between">
<el-select v-model="item[item['key']]" multiple :placeholder="`请选择${item.name}`">
<el-option v-for="item in dict.D_BB_AJLB" :key="item.dm" :label="item.zdmc" :value="item.dm" />
</el-select>
</div>
</template>
<template v-if="item.key == 'wp'">
<div class="condition-input-container flex just-between">
<el-select v-model="item[item['key']]" multiple :placeholder="`请选择${item.name}`" style="width: 240px">
<el-option v-for="item in dict.D_BZ_WPLX" :key="item.dm" :label="item.zdmc" :value="item.dm" />
</el-select>
</div>
</template>
<template v-if="item.key == 'ryxx'">
<div class="condition-input-container flex just-between" v-for="(value, index) in item[item['key']]">
<div>
<el-input v-model="item[item['key']][index].xm" :placeholder="`请输入姓名`" clearable></el-input>
</div>
<div>
<el-input v-model="item[item['key']][index].sfzh" :placeholder="`请输入身份证号`" clearable></el-input>
</div>
<div>
<el-button class="btn-margin-right" v-if="index == item[item['key']].length - 1"
@click="addInput(item['key'], indexs)" type="danger" size="mini">+</el-button>
<el-button class="btn-margin-right" v-if="index != item[item['key']].length - 1"
@click="removeItem(item['key'], index)" type="danger" size="mini">-</el-button>
</div>
</div>
</template>
<template v-else-if="item.key == 'jqlx'">
<div class="condition-input-container flex just-between" v-for="(value, index) in item[item['key']]">
<div>
<el-input @click="chooseMarksVisible = true" v-model="item[item['key']][index].lxmc"
:placeholder="`请输入${item.name}`" clearable></el-input>
</div>
<div>
<el-button class="btn-margin-right" @click="removeItem(item['key'], index)" type="danger"
size="mini">-</el-button>
</div>
</div>
</template>
</div>
</div>
</VueDraggable>
<!-- 空状态提示 -->
<div v-if="copyList.length === 0" class="empty-state">
<i class="el-icon-tickets"></i>
<p>暂无已选条件</p>
<p class="empty-tip">从上方拖拽条件到此处</p>
</div>
</div>
</div>
</div>
<ChooseIdeJqlb v-model="chooseMarksVisible" @choosed="choosed" :roleIds="roleIds" />
</template>
<script setup>
import { reactive, ref, watch,onMounted } from 'vue'
import ChooseIdeJqlb from '@/components/ChooseList/ChooseIdeJqlb/index.vue'
import { VueDraggable } from 'vue-draggable-plus'//npm install vue-draggable-plus
const props = defineProps({
dict: {
type: Object,
default: () => { },
},
list: {
type: Array,
default: () => [
'Joao',
'Jean',
'Johanna',
'Juan',
],
}, defaultData: {
type: Object,
default: () => { },
}, disabled: {
type: Boolean,
default: false
}
})
const dataConst = reactive([
">",
"<",
"=",
">=",
"<="
])
const dataList = ref([])
const gzmc = ref('')
const list=[{
name: "地点",
key: "dd",
}, {
name: '警情类型',
key: 'jqlx',
}, {
name: '人员信息',
key: 'ryxx',
}, {
name: '事件类型',
key: 'sjlx',
}, {
name: '物品',
key: 'wp',
}, {
name: '组织',
key: 'zz',
}, {
name: '开始时间',
key: 'kssj',
}, {
name: '结束时间',
key: 'jssj',
}, {
name: '次数',
key: 'cs',
}]
const copyList = ref([])
const clone = (val) => {
if (val.key == 'jqlx') {
dataList.value = dataList.value.filter(item => item.key != 'sjlx')
}
if (val.key == 'sjlx') {
dataList.value = dataList.value.filter(item => item.key != 'jqlx')
}
const data = copyList.value.find(item => item.name == val.name)
if (data) {
console.log("已存在")
} else {
switch (val.key) {
case 'cs':
return {
name: val.name,
key: val.key,
[val["key"]]: {}
}
case "wp":
return {
name: val.name,
key: val.key,
[val["key"]]: []
}
case 'ryxx':
return {
name: val.name,
key: val.key,
[val["key"]]: [{
xm: "",
sfzh: ""
}]
}
case 'kssj':
case 'jssj':
return {
name: val.name,
key: val.key,
[val["key"]]: []
}
case 'sjlx':
return {
name: val.name,
key: val.key,
[val["key"]]: []
}
default:
return {
name: val.name,
key: val.key,
[val["key"]]: [""]
}
}
}
}
watch(() => props.defaultData, (val) => {
if (val) {
gzmc.value = val.gzmc
const data = dataList.value.map(item => {
switch (item.key) {
case 'cs':
return {
name: item.name,
key: item.key,
[item["key"]]: val.cs && val.tj ? {
cs: val.cs,
tj: val.tj
} : null
}
case 'jssj':
case 'kssj':
return {
name: item.name,
key: item.key,
[item["key"]]: val[item.key] ? val[item.key] : null,
}
case 'zz':
return {
name: item.name,
key: item.key,
[item["key"]]: val[item.key] ? JSON.parse(val[item.key]).map(item => item.zzmc) : null,
}
case 'dd':
return {
name: item.name,
key: item.key,
[item["key"]]: val[item.key] ? JSON.parse(val[item.key]).map(item => item.dz) : null,
}
default:
return {
name: item.name,
key: item.key,
[item["key"]]: val[item.key] ? JSON.parse(val[item.key]) : null
}
}
})
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
}
}, { deep: true })
const addInput = (key, index) => {
if (key == 'ryxx') {
copyList.value[index][key].push({
xm: "",
sfzh: ""
})
} else {
copyList.value[index][key].push("")
}
}
// 移除项目
const removeItem = (key, index) => {
const data = copyList.value.findIndex(item => item.key == key)
if (copyList.value[data][key].length == 1) {
return
}
copyList.value[data][key].splice(index, 1)
}
const chooseMarksVisible = ref(false)
const roleIds = ref([])
const choosed = (val) => {
roleIds.value = val.map(item => item.id)
copyList.value.find(item => item.key == 'jqlx')['jqlx'] = val.map(item => {
return {
lxmc: item.zdmc,
lxdm: item.dm
}
})
}
const romes = (val) => {
copyList.value = copyList.value.filter(item => item.key !== val.key)
if (val.key == 'jqlx' || val.key == 'sjlx') {
dataList.value = list
}
}
const promes = ref({})
// 新增
const retValue = () => {
if (gzmc.value == '') {
return
}
const data = copyList.value.map(item => {
return {
[item.key]: item[item.key]
}
})
promes.value = data.reduce((acc, cur) => {
return { ...acc, ...cur }
}, {})
promes.value = { ...promes.value, ...promes.value.cs, gzmc: gzmc.value }
if (promes.value.dd && promes.value.dd.length > 0) {
const dd = promes.value.dd.map(item => {
return { dz: item }
})
promes.value.dd = JSON.stringify(dd)
}
if (promes.value.zz && promes.value.zz.length > 0) {
const zz = promes.value.zz.map(item => {
return { zzmc: item }
})
promes.value.zz = JSON.stringify(zz)
}
const sjlx = copyList.value.find(item => item.key == 'sjlx')
if (sjlx) {
const data = props.dict.D_BB_AJLB.filter(item => {
if (sjlx['sjlx'].includes(item.dm)) {
return item
}
}).map(item => {
return {
lxmc: item.zdmc,
lxdm: item.dm
}
})
promes.value.sjlx = JSON.stringify(data)
}
const wplx = copyList.value.find(item => item.key == 'wp')
if (wplx) {
const data = props.dict.D_BZ_WPLX.filter(item => {
if (wplx['wp'].includes(item.dm)) {
return item
}
}).map(item => {
return {
wpmc: item.zdmc,
wpdm: item.dm
}
})
promes.value.wp = JSON.stringify(data)
}
if (promes.value.ryxx && promes.value.ryxx.length > 0) {
promes.value.ryxx = JSON.stringify(promes.value.ryxx)
}
if (promes.value.jqlx && promes.value.jqlx.length > 0) {
promes.value.jqlx = JSON.stringify(promes.value.jqlx)
}
return promes.value
}
defineExpose({
retValue
})
</script>
<style lang="scss" scoped>
.regulation-wrapper {
padding: 20px;
background: #f5f7fa;
border-radius: 12px;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}
// 条件区域通用样式
.condition-section,
.selected-section {
background: white;
border-radius: 10px;
padding: 10px;
// margin-bottom: 20px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
transition: all 0.3s ease;
}
.condition-section:hover,
.selected-section:hover {
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}
// 区域标题
.section-title {
display: flex;
align-items: center;
margin-bottom: 16px;
color: #303133;
font-weight: 600;
font-size: 16px;
padding-bottom: 12px;
border-bottom: 2px solid #e6f7ff;
i {
color: #409eff;
margin-right: 8px;
font-size: 18px;
}
.selected-count {
margin-left: 10px;
font-size: 14px;
font-weight: normal;
color: #606266;
background: #f0f9ff;
padding: 2px 8px;
border-radius: 12px;
min-width: 24px;
text-align: center;
}
}
// 可用条件区域
.available-conditions {
// min-height: 100px;
}
.flex-wrap {
display: flex;
flex-wrap: wrap;
gap: 12px;
}
.condition-button {
background: linear-gradient(135deg, #409eff 0%, #66b1ff 100%);
color: white !important;
border: none !important;
border-radius: 8px !important;
padding: 8px 16px !important;
font-size: 14px !important;
transition: all 0.3s ease !important;
min-width: 120px;
box-shadow: 0 2px 8px rgba(64, 158, 255, 0.3);
&:hover {
background: linear-gradient(135deg, #66b1ff 0%, #409eff 100%) !important;
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(64, 158, 255, 0.4);
}
i {
margin-right: 6px;
}
}
// 拖拽提示
.drag-hint {
display: flex;
align-content: flex-start;
// align-items: center;
justify-content: center;
padding: 20px;
color: #909399;
font-size: 14px;
i {
margin-right: 8px;
font-size: 16px;
animation: bounce 1.5s infinite;
}
@keyframes bounce {
0%,
20%,
50%,
80%,
100% {
transform: translateY(0);
}
40% {
transform: translateY(-10px);
}
60% {
transform: translateY(-5px);
}
}
}
// 已选条件区域
.selected-container {
min-height: 120px;
border: 2px dashed #dcdfe6;
border-radius: 8px;
padding: 20px;
transition: all 0.3s ease;
background-color: #dcdfe670;
&:hover {
border-color: #409eff;
background: #f0f9ff;
}
}
.selected-list {
display: flex;
min-height: 100px;
width: 100%;
flex-wrap: wrap;
}
// 拖拽项样式
.draggable-item {
position: relative;
padding: 3px;
margin: 8px;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
display: table-cell;
justify-content: space-between;
text-align: center;
flex-wrap: wrap;
&:hover {
transform: translateY(-2px) scale(1.02);
box-shadow: 0 6px 16px rgba(103, 194, 58, 0.4);
}
&.ghost {
opacity: 0.6;
transform: rotate(5deg);
}
}
.item-content {
background: white;
border-radius: 8px;
padding: 20px 12px 12px 12px;
display: flex;
align-items: center;
justify-content: space-between;
min-width: 140px;
position: relative;
}
.item-text {
font-size: 14px;
color: #303133;
font-weight: 500;
flex: 1;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin-right: 10px;
}
.item-remove {
color: #c0c4cc;
font-size: 18px;
cursor: pointer;
transition: all 0.3s ease;
padding: 4px;
border-radius: 50%;
&:hover {
color: #f56c6c;
background: #fef0f0;
transform: rotate(90deg);
}
}
/* 规则名称区域 */
.rule-name-section {
margin-bottom: 10px;
}
.rule-name-label {
width: 100px;
}
/* 项目删除按钮 */
.item-remove-btn {
position: absolute;
top: 5px;
right: 10px;
}
/* 条件输入容器 */
.condition-input-container {
flex-wrap: nowrap;
margin-top: 10px;
}
/* 计数条件容器 */
.count-condition-container {
margin-top: 10px;
display: flex;
}
/* 条件选择框 */
.condition-select {
width: 100px;
}
/* 按钮右侧边距 */
.btn-margin-right {
margin-right: 5px;
}
// 空状态样式
.empty-state {
text-align: center;
padding: 40px 20px;
color: #909399;
i {
font-size: 48px;
margin-bottom: 16px;
color: #dcdfe6;
transition: color 0.3s ease;
}
p {
margin: 0;
font-size: 14px;
}
.empty-tip {
font-size: 12px;
color: #c0c4cc;
margin-top: 8px;
}
&:hover i {
color: #409eff;
}
}
// 拖拽效果
.ghost {
opacity: 0.6;
background-color: #e6f7ff;
border: 2px dashed #409eff;
border-radius: 8px;
}
// 响应式设计
@media (max-width: 768px) {
.regulation-wrapper {
padding: 15px;
}
.condition-section,
.selected-section {
padding: 15px;
}
.condition-button {
min-width: 100px;
font-size: 13px !important;
}
.item-content {
min-width: 120px;
padding: 10px 12px;
}
}
:v-deep .el-select {
width: 59%;
}
</style>

View File

@ -0,0 +1,666 @@
<template>
<!-- 可用条件类型列表 -->
<div class="regulation-wrapper">
<div class="rule-name-section flex align-center">
<div class="rule-name-label">规则名称</div>
<el-input v-model="gzmc" :disabled="disabled" placeholder="请输入规则名称" class="search-input" clearable></el-input>
</div>
<!-- 可用条件区域 -->
<div class="condition-section">
<div class="available-conditions">
<VueDraggable class="flex-wrap" v-model="dataList" ghostClass="ghost"
:group="{ name: 'people', pull: 'clone', put: false }" :clone="clone">
<el-button v-for="item in dataList" :key="item.name" class="condition-button" size="small">
<i class="el-icon-document-add"></i>
{{ item.name }}
</el-button>
</VueDraggable>
</div>
</div>
<!-- 拖拽提示 -->
<div class="drag-hint">
<i class="el-icon-arrow-down"></i>
<span>拖拽条件到下方区域</span>
</div>
<!-- 已选条件区域 -->
<div class="selected-section">
<div class="section-title">
<i class="el-icon-check-square"></i>
<span>已选条件</span>
<span class="selected-count">{{ copyList.length }}</span>
</div>
<div class="selected-container">
<VueDraggable v-model="copyList" :group="{ name: 'people', pull: !disabled, put: !disabled }" ghostClass="ghost"
class="selected-list" itemKey="name">
<div v-for="(item, indexs) in copyList" :key="item" class="draggable-item">
<div class="item-content">
<div v-if="!disabled" class="item-remove-btn" @click="romes(item)"><el-icon :size="16">
<Close />
</el-icon></div>
<span class="item-text">{{ item.name }}</span>
</div>
<div v-if="item[item['key']]">
<template v-if="item.key == 'dd'">
<div class="condition-input-container flex just-between" v-for="(value, index) in item[item['key']]">
<div>
<el-input v-model="item[item['key']][index]" :placeholder="`请输入${item.name}`" clearable></el-input>
</div>
<div>
<el-button class="btn-margin-right" v-if="index == item[item['key']].length - 1"
@click="addInput(item['key'], indexs)" type="danger" size="mini">+</el-button>
<el-button class="btn-margin-right" v-if="index != item[item['key']].length - 1"
@click="removeItem(item['key'], index)" type="danger" size="mini">-</el-button>
</div>
</div>
</template>
<template v-else-if="item.key == 'sfbq'">
<div class="condition-input-container flex just-between" v-for="(value, index) in item[item['key']]">
<div>
<el-input @click="chooseIdentityVisible = true" v-model="item[item['key']][index].bqmc"
:placeholder="`请输入${item.name}`" clearable></el-input>
</div>
<div>
<el-button class="btn-margin-right" @click="removeItem(item['key'], index)" type="danger"
size="mini">-</el-button>
</div>
</div>
</template>
<!-- <template v-if="item.key == 'cs'">
<div class="count-condition-container">
<el-select v-model="item[item['key']].tj" placeholder="请选择条件" class="condition-select">
<el-option :label="item" :value="item" v-for="(item, index) in dataConst" :key="index"></el-option>
</el-select>
<el-input-number v-model="item[item['key']].cs" :min="1" :max="1000" />
</div>
</template> -->
<template v-if="item.key == 'xwbq'">
<div class="condition-input-container flex just-between" v-for="(value, index) in item[item['key']]">
<div>
<el-input @click="chooseMarksVisible = true" v-model="item[item['key']][index].bqmc"
:placeholder="`请输入${item.name}`" clearable></el-input>
</div>
<div>
<el-button class="btn-margin-right" @click="removeItem(item['key'], index)" type="danger"
size="mini">-</el-button>
</div>
</div>
</template>
<template v-if="item.key == 'zz'">
<div class="condition-input-container flex just-between" v-for="(value, index) in item[item['key']]">
<div>
<el-input v-model="item[item['key']][index]" :placeholder="`请输入${item.name}`" clearable></el-input>
</div>
<div>
<el-button class="btn-margin-right" v-if="index == item[item['key']].length - 1"
@click="addInput(item['key'], indexs)" type="danger" size="mini">+</el-button>
<el-button class="btn-margin-right" v-if="index != item[item['key']].length - 1"
@click="removeItem(item['key'], index)" type="danger" size="mini">-</el-button>
</div>
</div>
</template>
<template v-if="item.key == 'kssj'">
<div class="condition-input-container flex just-between">
<div>
<el-date-picker value-format="YYYY-MM-DD" format="YYYY-MM-DD" v-model="item[item['key']]"
type="date" :placeholder="`请选择${item.name}`" />
</div>
</div>
</template>
<template v-if="item.key == 'jssj'">
<div class="condition-input-container flex just-between">
<div>
<el-date-picker value-format="YYYY-MM-DD" format="YYYY-MM-DD" v-model="item[item['key']]"
type="date" :placeholder="`请选择${item.name}`" />
</div>
</div>
</template>
</div>
</div>
</VueDraggable>
<!-- 空状态提示 -->
<div v-if="copyList.length === 0" class="empty-state">
<i class="el-icon-tickets"></i>
<p>暂无已选条件</p>
<p class="empty-tip">从上方拖拽条件到此处</p>
</div>
</div>
</div>
</div>
<ChooseMarks v-model="chooseMarksVisible" @choosed="choosed" :roleIds="roleIds" />
<ChooseIdentity v-model="chooseIdentityVisible" @choosed="choosedIdentity" :roleIds="roleIdsIdentity" />
</template>
<script setup>
import { reactive, ref, watch } from 'vue'
import ChooseMarks from "@/components/ChooseList/ChooseMarks/index.vue";
import ChooseIdentity from "@/components/ChooseList/ChooseIdentity/index.vue";
import { ElMessage } from "element-plus";
import { VueDraggable } from 'vue-draggable-plus'//npm install vue-draggable-plus
const props = defineProps({
dict: {
type: Array,
default: () => [],
},
list: {
type: Array,
default: () => [
'Joao',
'Jean',
'Johanna',
'Juan',
],
}, defaultData: {
type: Object,
default: () => { },
}, disabled: {
type: Boolean,
default: false
}
})
const dataConst = reactive([
">",
"<",
"="
])
const dataList = ref([{
name: "地点",
key: "dd",
id: 1
}, {
name: "身份标签",
key: "sfbq",
id: 2
},
// {
// name: "次数",
// key: "cs",
// id: 3
// },
{
name: "行为标签",
key: "xwbq",
id: 4
}, {
name: "组织",
key: "zz",
id: 5
}, {
name: "开始时间",
key: "kssj",
id: 6
}, {
name: "结束时间",
key: "jssj",
id: 7
}])
const gzmc = ref('')
const copyList = ref([])
const clone = (val) => {
console.log(val);
const data = copyList.value.find(item => item.name == val.name)
if (data) {
console.log("已存在")
} else {
// if (val.key == 'cs') {
// return {
// name: val.name,
// key: val.key,
// [val["key"]]: {}
// }
// } else {
if (val.key == 'cs' || val.key == 'kssj' || val.key == 'jssj') {
return {
name: val.name,
key: val.key,
[val["key"]]: []
}
}
else {
return {
name: val.name,
key: val.key,
[val["key"]]: [""]
}
}
}
}
watch(() => props.defaultData, (val) => {
if (val) {
gzmc.value = val.gzmc
const data = dataList.value.map(item => {
switch (item.key) {
// case 'cs':
// return {
// name: item.name,
// key: item.key,
// [item["key"]]: {
// cs: val.cs,
// tj: val.tj
// }
// }
case 'jssj':
case 'kssj':
return {
name: item.name,
key: item.key,
[item["key"]]: val[item.key] ? val[item.key] : null,
}
case 'zz':
return {
name: item.name,
key: item.key,
[item["key"]]: val[item.key] ? JSON.parse(val[item.key]).map(item => item.zzmc) : null,
}
case 'dd':
return {
name: item.name,
key: item.key,
[item["key"]]: val[item.key] ? JSON.parse(val[item.key]).map(item => item.dz) : null,
}
default:
return {
name: item.name,
key: item.key,
[item["key"]]: val[item.key] ? JSON.parse(val[item.key]) : null
}
}
})
copyList.value = data.filter(item => {
return item[item.key] != null
})
}
}, { deep: true })
const addInput = (key, index) => {
copyList.value[index][key].push("")
}
// 移除项目
const removeItem = (key, index) => {
const data = copyList.value.findIndex(item => item.key == key)
if (copyList.value[data][key].length == 1) {
return
}
copyList.value[data][key].splice(index, 1)
}
// 选择预警标签
const roleIds = ref([])
const chooseMarksVisible = ref()
const choosed = (val) => {
roleIds.value = val.map(item => item.id)
copyList.value.find(item => item.key == 'xwbq')['xwbq'] = val.map(item => {
return {
bqdm: item.bqDm,
bqmc: item.bqMc
}
})
}
// 选择身份标签
const chooseIdentityVisible = ref()
const roleIdsIdentity = ref([])
const choosedIdentity = (val) => {
roleIdsIdentity.value = val.map(item => item.id)
copyList.value.find(item => item.key == 'sfbq')['sfbq'] = val.map(item => {
return {
bqdm: item.bqDm,
bqmc: item.bqMc
}
})
}
const romes = (val) => {
copyList.value = copyList.value.filter(item => item.key !== val.key)
}
const promes = ref({})
// 新增
const retValue = () => {
if (gzmc.value == '') {
return
}
const data = copyList.value.map(item => {
return {
[item.key]: item[item.key]
}
})
promes.value = data.reduce((acc, cur) => {
return { ...acc, ...cur }
}, {})
promes.value = { ...promes.value, gzmc: gzmc.value }
if (promes.value.dd && promes.value.dd.length > 0) {
promes.value.dd = promes.value.dd.map(item => {
return { dz: item }
})
}
if (promes.value.zz && promes.value.zz.length > 0) {
promes.value.zz = promes.value.zz.map(item => {
return { zzmc: item }
})
}
promes.value.kssj = promes.value.kssj ? promes.value.kssj.toString() : null
promes.value.jssj = promes.value.jssj ? promes.value.jssj.toString() : null
const retData = {
...promes.value,
dd: promes.value.dd ? JSON.stringify(promes.value.dd) : null,
sfbq: promes.value.sfbq ? JSON.stringify(promes.value.sfbq) : null,
xwbq: promes.value.xwbq ? JSON.stringify(promes.value.xwbq) : null,
zz: promes.value.zz ? JSON.stringify(promes.value.zz) : null,
}
return retData
}
defineExpose({
retValue
})
</script>
<style lang="scss" scoped>
.regulation-wrapper {
padding: 20px;
background: #f5f7fa;
border-radius: 12px;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}
// 条件区域通用样式
.condition-section,
.selected-section {
background: white;
border-radius: 10px;
padding: 10px;
// margin-bottom: 20px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
transition: all 0.3s ease;
}
.condition-section:hover,
.selected-section:hover {
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}
// 区域标题
.section-title {
display: flex;
align-items: center;
margin-bottom: 16px;
color: #303133;
font-weight: 600;
font-size: 16px;
padding-bottom: 12px;
border-bottom: 2px solid #e6f7ff;
i {
color: #409eff;
margin-right: 8px;
font-size: 18px;
}
.selected-count {
margin-left: 10px;
font-size: 14px;
font-weight: normal;
color: #606266;
background: #f0f9ff;
padding: 2px 8px;
border-radius: 12px;
min-width: 24px;
text-align: center;
}
}
// 可用条件区域
.available-conditions {
// min-height: 100px;
}
.flex-wrap {
display: flex;
flex-wrap: wrap;
gap: 12px;
}
.condition-button {
background: linear-gradient(135deg, #409eff 0%, #66b1ff 100%);
color: white !important;
border: none !important;
border-radius: 8px !important;
padding: 8px 16px !important;
font-size: 14px !important;
transition: all 0.3s ease !important;
min-width: 120px;
box-shadow: 0 2px 8px rgba(64, 158, 255, 0.3);
&:hover {
background: linear-gradient(135deg, #66b1ff 0%, #409eff 100%) !important;
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(64, 158, 255, 0.4);
}
i {
margin-right: 6px;
}
}
// 拖拽提示
.drag-hint {
display: flex;
align-content: flex-start;
// align-items: center;
justify-content: center;
padding: 20px;
color: #909399;
font-size: 14px;
i {
margin-right: 8px;
font-size: 16px;
animation: bounce 1.5s infinite;
}
@keyframes bounce {
0%,
20%,
50%,
80%,
100% {
transform: translateY(0);
}
40% {
transform: translateY(-10px);
}
60% {
transform: translateY(-5px);
}
}
}
// 已选条件区域
.selected-container {
min-height: 120px;
border: 2px dashed #dcdfe6;
border-radius: 8px;
padding: 20px;
transition: all 0.3s ease;
background-color: #dcdfe670;
&:hover {
border-color: #409eff;
background: #f0f9ff;
}
}
.selected-list {
min-height: 100px;
}
// 拖拽项样式
.draggable-item {
position: relative;
// background: rgba(103, 194, 58, 0.3);
padding: 3px;
margin: 8px;
// box-shadow: 0 4px 12px rgba(103, 194, 58, 0.3);
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
display: table-cell;
justify-content: space-between;
// cursor: move;
text-align: center;
&:hover {
transform: translateY(-2px) scale(1.02);
box-shadow: 0 6px 16px rgba(103, 194, 58, 0.4);
}
&.ghost {
opacity: 0.6;
transform: rotate(5deg);
}
}
.item-content {
background: white;
border-radius: 8px;
padding: 20px 12px 12px 12px;
display: flex;
align-items: center;
justify-content: space-between;
min-width: 140px;
position: relative;
}
.item-text {
font-size: 14px;
color: #303133;
font-weight: 500;
flex: 1;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin-right: 10px;
}
.item-remove {
color: #c0c4cc;
font-size: 18px;
cursor: pointer;
transition: all 0.3s ease;
padding: 4px;
border-radius: 50%;
&:hover {
color: #f56c6c;
background: #fef0f0;
transform: rotate(90deg);
}
}
/* 规则名称区域 */
.rule-name-section {
margin-bottom: 10px;
}
.rule-name-label {
width: 100px;
}
/* 项目删除按钮 */
.item-remove-btn {
position: absolute;
top: 5px;
right: 10px;
}
/* 条件输入容器 */
.condition-input-container {
flex-wrap: nowrap;
margin-top: 10px;
}
/* 计数条件容器 */
.count-condition-container {
margin-top: 10px;
display: flex;
}
/* 条件选择框 */
.condition-select {
width: 100px;
}
/* 按钮右侧边距 */
.btn-margin-right {
margin-right: 5px;
}
// 空状态样式
.empty-state {
text-align: center;
padding: 40px 20px;
color: #909399;
i {
font-size: 48px;
margin-bottom: 16px;
color: #dcdfe6;
transition: color 0.3s ease;
}
p {
margin: 0;
font-size: 14px;
}
.empty-tip {
font-size: 12px;
color: #c0c4cc;
margin-top: 8px;
}
&:hover i {
color: #409eff;
}
}
// 拖拽效果
.ghost {
opacity: 0.6;
background-color: #e6f7ff;
border: 2px dashed #409eff;
border-radius: 8px;
}
// 响应式设计
@media (max-width: 768px) {
.regulation-wrapper {
padding: 15px;
}
.condition-section,
.selected-section {
padding: 15px;
}
.condition-button {
min-width: 100px;
font-size: 13px !important;
}
.item-content {
min-width: 120px;
padding: 10px 12px;
}
}
:v-deep .el-select {
width: 59%;
}
</style>

View File

@ -1,53 +0,0 @@
<template>
<div class="dialog" v-if="dialogForm">
<div class="head_box">
<span class="title">{{ title }}模型 </span>
<div>
<el-button type="primary" size="small" :loading="loading" @click="submit" v-show="title!='详情'">保存</el-button>
<el-button size="small" @click="close">关闭</el-button>
</div>
</div>
<div class="form_cnt">
<FormMessage :formList="formData" v-model="listQuery" ref="elform" :rules="rules">
</FormMessage>
</div>
</div>
</template>
<script setup>
import { reactive, ref } from 'vue'
import FormMessage from "@/components/aboutTable/FormMessage.vue";
const dialogForm = ref(false)
const title=ref("新增")
const init = (type,row) => {
dialogForm.value = true
if (type=='edit') {
title.value="编辑"
} else if (type=='add') {
title.value="新增"
} else {
title.value="详情"
}
}
// 表单内容
const formData = reactive([
{ label: "模型名称", prop: "mxmc", type: "input", width: "40%" },
{ label: "模型类型", prop: "mxlx", type: "input", width: "40%"},
])
const loading=ref(false)
// 新增
const submit = () => {
loading.value = true
}
// 关闭
const close = () => {
dialogForm.value = false
}
defineExpose({
init
})
</script>
<style lang="scss" scoped>
</style>

View File

@ -0,0 +1,35 @@
// 正文
export const textStyle = (data) => {
return `<p style="text-indent: 2em;"><span style="font-size: 16px; font-family: 仿宋;">${data}</span></p>`
}
//一级标题
export const Firstlevelheading = (data) => {
return `<p style="text-indent: 2em;"><span style="font-size: 16px; font-family: 黑体;">${data}</span></p>`
}
//二级标题
export const Subheading = (data) => {
return `<p style="text-indent: 2em;"><span style="font-size: 16px; font-family: 仿宋;">${data}</span></p>`
}
export const BiheadlinegTitle = (data) => {
return `<p style="text-indent: 2em;"><span style="font-size: 16px; font-family: 楷体;"><strong>${data}</strong></span></p>`
}
// 大标题
export const BigTitle = (data) => {
return `<h4 style="text-align: center;"><span style="color: rgb(225, 60, 57); font-size: 32px; font-family: 标楷体;">${data}</span></h4>`
}
export const headTitle = (data) => {
return `<p style="text-align: left;"><span style="color: rgb(225, 60, 57); font-size: 16px; font-family: 标楷体;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;${data.orgName}编 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;第${data.serialNumber}号&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;${data.time}&nbsp; </span></p ><hr/>`
}
export const report = (data) => {
return `<p><br></p ><p style="text-indent: 2em;">报抄:西藏公安厅</p ><hr/><p> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;`
}
export const signature = () => {
return `<p> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 承办人: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 核稿人 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;签发人:</p >`
}
export const newTotitle = (data) => {
return `<p style="text-align: center;"><span style="color: rgb(225, 60, 57); font-size: 16px; font-family: 标楷体;">${data.org} &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ${data.time}</span></p><hr/><p><br></p>`
}
export const fbtool = (data) => {
return `<p style="text-align: center;"><span style="font-size: 24px;">${data} </span></p>`
}

View File

@ -0,0 +1,202 @@
<template>
<!-- v-if="dialogForm" -->
<div class="dialog" >
<div class="head_box">
<span class="title">{{ title }}规则 </span>
<div>
<el-button type="primary" size="small" :loading="loading" @click="submit" v-show="title != '详情'">保存</el-button>
<el-button size="small" @click="close">关闭</el-button>
</div>
</div>
<div class="form_cnt">
<EarlyWarning v-if="item.mxlx == YJGZ" ref="regulationRef"
:dict="{D_BB_AJLB,D_BZ_WPLX}"
:defaultData="defaultData" :disabled="false" />
<Regulation v-if="item.mxlx ==SSYJ" ref="regulationRef" :dict="{D_BZ_RYBQ}"
:defaultData="defaultData" :disabled="false" />
</div>
</div>
</template>
<script setup>
import { reactive, ref ,getCurrentInstance, onMounted} from 'vue'
import { ElMessage } from "element-plus";
import { addSsyjpz, editSsyjpz, addYjgzpz, editYjgzpz } from '@/api/model'
import emitter from "@/utils/eventBus.js";
import {mxglSsyjpzSelectList,getYjgzpzSelectList} from '@/api/model'
import Regulation from "./FourColor/regulation.vue";
import EarlyWarning from "./EarlyWarning/regulation.vue";
const props = defineProps({
item: {
type: Object,
default: () => {},
}
})
const { proxy } = getCurrentInstance();
const { D_BB_AJLB,D_BZ_WPLX,D_BZ_RYBQ} = proxy.$dict("D_BB_AJLB","D_BZ_WPLX","D_BZ_RYBQ")
const title = ref("新增")
const emit = defineEmits(['getList'])
const listQuery = ref()
const defaultData = ref({})
const SSYJ = '02'
const YJGZ='01'
onMounted(() => {
switch (props.item.mxlx) {
case SSYJ:
getmxglSsyjpzSelectList()
break;
case YJGZ:
getgetYjgzpzSelectList()
break;
default:
break;
}
})
const getgetYjgzpzSelectList = () => {
const promes = {
mxid:props.item.id
}
getYjgzpzSelectList(promes).then((res) => {
if (res.length > 0) {
listQuery.value = props.item
defaultData.value = res[0]
} else {
defaultData.value = {}
}
})
}
const getmxglSsyjpzSelectList=() => {
const promes = {
mxid:props.item.id
}
mxglSsyjpzSelectList(promes).then((res) => {
if (res.length > 0) {
listQuery.value = props.item
defaultData.value = res[0]
} else {
defaultData.value = {}
}
})
}
const regulationRef = ref(null)
const loading = ref(false)
// 新增
const submit = () => {
switch (props.item.mxlx) {
case SSYJ:
addSsyj()
break;
case YJGZ:
addYjgzpzs()
break;
default:
break;
}
}
const addSsyj = () => {
const data = regulationRef.value.retValue()
if (!data || !data.gzmc) {
ElMessage.warning('请填写规则名称')
return
}
if (!defaultData.value) {
const promes = {
mxid: props.item.id,
...data
}
addSsyjpz(promes).then((result) => {
ElMessage.success('新增成功')
emit('getList')
close()
}).catch((err) => {
ElMessage.error(err.message)
});
} else {
editSsyjpz({
id: defaultData.value.id,
...data
}).then((result) => {
ElMessage.success('编辑成功')
emit('getList')
close()
}).catch((err) => {
ElMessage.error(err.message)
});
}
}
const addYjgzpzs = () => {
const data = regulationRef.value.retValue()
if (!data || !data.gzmc) {
ElMessage.warning('请填写规则名称')
return
}
if (!data || !data.sjlx&&!data.jqlx) {
ElMessage.warning('请事件类型和警情类型必须选择一个')
return
}
if (!defaultData.value) {
const promes = {
mxid:props.item.id,
...data
}
addYjgzpz(promes).then((result) => {
ElMessage.success('新增成功')
emit('getList')
close()
}).catch((err) => {
ElMessage.error(err.message)
});
} else {
console.log( defaultData.value.id);
editYjgzpz({
id: defaultData.value.id,
...data
}).then((result) => {
ElMessage.success('编辑成功')
emit('getList')
close()
}).catch((err) => {
ElMessage.error(err.message)
});
}
}
const close = () => {
emitter.emit('changeModel', { name: '研判首页', row: {} });
}
</script>
<style lang="scss" scoped>
::v-deep .el-button+.el-button {
margin-left: 0px;
}
.flex {
display: flex;
}
.flex-wrap {
flex-wrap: wrap;
}
.just-between {
justify-content: space-between;
}
.mb-10 {
margin-bottom: 10px;
}
.mr-10 {
margin-right: 10px;
}
</style>

View File

@ -1,67 +0,0 @@
<template>
<div class="dialog" v-if="dialogForm">
<div class="head_box">
<span class="title">{{ title }}规则 </span>
<div>
<el-button type="primary" size="small" :loading="loading" @click="submit" v-show="title != '详情'">保存</el-button>
<el-button size="small" @click="close">关闭</el-button>
</div>
</div>
<div class="form_cnt">
<VueDraggable @update="onUpdate"
@add="onAdd"
@remove="remove">
<el-button type="primary" v-for="(item,index) in listBut" :key="index">{{ item }}</el-button>
</VueDraggable>
<VueDraggable>
<el-button type="primary" v-for="(item,index) in listBut" :key="index">{{ item }}</el-button>
</VueDraggable>
</div>
</div>
</template>
<script setup>
import { reactive, ref } from 'vue'
import FormMessage from "@/components/aboutTable/FormMessage.vue";
// import { VueDraggable } from 'vue-draggable-plus'
const dialogForm = ref(false)
const title = ref("新增")
const init = (type, row) => {
dialogForm.value = true
if (type == 'edit') {
title.value = "编辑"
} else if (type == 'add') {
title.value = "新增"
} else {
title.value = "详情"
}
}
const loading = ref(false)
// 新增
const submit = () => {
loading.value = true
}
const listBut = ref(["物品", "人员", "组织", "次数", "事件", "地点", "整情"])
// 关闭
const close = () => {
dialogForm.value = false
}
const onUpdate = (evt) => {
console.log(evt)
}
// 新增
const onAdd = (evt) => {
console.log(evt)
}
// 删除
const remove = (evt) => {
console.log(evt)
}
defineExpose({
init
})
</script>
<style lang="scss" scoped></style>

View File

@ -0,0 +1,209 @@
<template>
<div>
<div class="titleBox">
<PageTitle title="预警列表">
<el-button type="primary" size="small" @click="yzSsyjpzMxgzxl()">新增</el-button>
<!-- <el-button type="primary" size="small" :disabled="ids.length == 0" @click="deleteRule(ids)">批量删除</el-button> -->
<el-button size="small" @click="retenHome()">返回</el-button>
</PageTitle>
</div>
<!-- 搜索 -->
<div ref="searchBox">
<Search :searchArr="searchConfiger" @submit="onSearch" />
</div>
<!-- 表格 -->
<div class="tabBox">
<MyTable :tableData="pageData.tableData" :tableColumn="pageData.tableColumn" :tableHeight="pageData.tableHeight"
:key="pageData.keyCount" :tableConfiger="pageData.tableConfiger" :controlsWidth="pageData.controlsWidth"
@chooseData="chooseData">
<template #tjName="{ row }">
<div class="flex one_text_detail" v-if="row.tj">{{ ` ${row.tj} ${row.cs}` }} </div>
</template>
</MyTable>
<Pages @changeNo="changeNo" @changeSize="changeSize" :tableHeight="pageData.tableHeight" :pageConfiger="{
...pageData.pageConfiger,
total: pageData.total
}"></Pages>
</div>
</div>
</template>
<script setup>
import { ElMessage } from "element-plus";
import emitter from "@/utils/eventBus.js";
import { deleteYjgzpz,getYjgzpzMxgzxl,getYjxxPageList ,getSsyjpzMxgzxl} from "@/api/model";
import PageTitle from "@/components/aboutTable/PageTitle.vue";
import MyTable from "@/components/aboutTable/MyTable.vue";
import Pages from "@/components/aboutTable/Pages.vue";
import Search from "@/components/aboutTable/Search.vue";
import { reactive, ref, onMounted, getCurrentInstance } from "vue";
const props = defineProps({
item: {
type: Object,
default: () => ({})
}
})
const { proxy } = getCurrentInstance();
const { D_BB_AJLB,D_BZ_WPLX} = proxy.$dict("D_BB_AJLB","D_BZ_WPLX")
const regulation = ref(null)
const queryFrom = ref({})
const searchBox = ref(); //搜索框
const searchConfiger = ref([
{
label: "时间",
prop: "startTime",
placeholder: "请选择时间",
showType: "daterange"
},
]);
const pageData = reactive({
tableData: [],
keyCount: 0,
tableConfiger: {
rowHieght: 61,
showSelectType: "null",
loading: false
},
total: 0,
pageConfiger: {
pageSize: 20,
pageCurrent: 1
},
controlsWidth: 300,
tableColumn: [
{ label: "预警时间", prop: "gzmc", showOverflowTooltip: true },
{ label: "类型", prop: "jssj", showOverflowTooltip: true, showSolt: true },
{ label: "内容", prop: "kssj", showOverflowTooltip: true, showSolt: true },
]
});
onMounted(() => {
getList();
tabHeightFn();
});
// 搜索
const onSearch = (val) => {
queryFrom.value.startTime = val.startTime&&val.startTime.length > 0 ? val.startTime[0] : '';
queryFrom.value.endTime = val.startTime&&val.startTime.length > 0 ? val.startTime[1] : '';
pageData.pageConfiger.pageCurrent = 1;
getList();
};
const changeNo = (val) => {
pageData.pageConfiger.pageCurrent = val;
getList();
};
const changeSize = (val) => {
pageData.pageConfiger.pageSize = val;
getList();
};
//
// 获取列表
const getList = () => {
const promes = {
...pageData.pageConfiger,
...queryFrom.value,
mxid:props.item.id,
}
getYjxxPageList(promes).then((res) => {
pageData.tableData = res.records
pageData.total = res.total
});
};
const retenHome = () => {
emitter.emit('changeModel', { name: '研判首页', row: {} });
}
const openAddRule = (type, item, row) => {
regulation.value.init(type, item, row)
}
const ids = ref([])
const chooseData = (val) => {
ids.value = val.map(item => item.id)
}
const deleteRule = (row) => {
proxy.$confirm('是否删除该规则, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let list
if (Array.isArray(row)) {
list = ids.value
} else {
list =[row]
}
deleteYjgzpz({ids:list}).then(() => {
ElMessage.success("删除成功");
getList()
})
}).catch((err) => {
proxy.$message({
type: 'info',
message: '已取消删除'
});
});
}
const yzSsyjpzMxgzxl = (params) => {
getYjgzpzMxgzxl({id:params}).then((res) => {
console.log(res);
})
}
const jsonParse = (val) => {
if (val) {
return JSON.parse(val)
}
}
// 表格高度计算
const tabHeightFn = () => {
pageData.tableHeight = window.innerHeight - searchBox.value.offsetHeight - 250;
window.onresize = function () {
tabHeightFn();
};
};
</script>
<style lang="scss" scoped>
.checkbox-group {
display: flex;
gap: 20px;
}
.basic-info {
display: flex;
gap: 15px;
.avatar {
width: 80px;
height: 80px;
overflow: hidden;
border-radius: 4px;
img {
width: 100%;
height: 100%;
object-fit: cover;
}
}
.info-list {
display: flex;
flex-direction: column;
gap: 5px;
}
}
.control-buttons {
display: flex;
gap: 10px;
}
</style>

View File

@ -11,48 +11,72 @@
<div ref="searchBox">
<Search :searchArr="searchConfiger" @submit="onSearch"> </Search>
</div>
<ul class="cntlsit mb10" v-if="show" v-infinite-scroll="load" :style="{ height: listHeight + 'px' }" v-loading="loading">
<li class="cntItem" v-for="(it, idx) in 10" :key="idx">
<div class="ww100" @click.stop="openAddModel('detail', it)"><img class="ww100" style="height: 168px;" src="@/assets/images/mxbg.jpg" alt=""></div>
<div class="foot">
<span class="ml10 pointer" style="color:#027ff0 ;" @click="openAddRule"><el-icon style="top: 2px;">
<Document />
</el-icon>查看规则</span>
<span class="ml10 pointer" style="color:#027ff0 ;" @click="openAddModel('edit', it)"><el-icon
style="top: 2px;">
<Edit />
</el-icon>编辑</span>
<span class="ml10 pointer" style="color:#f4ac47 ;"><el-icon style="top: 2px;">
<Files />
</el-icon>删除</span>
<ul class="cntlsit mb10" v-if="show" v-infinite-scroll="load" :style="{ height: listHeight + 'px' }"
v-loading="loading">
<li class="model-card" v-for="(it, idx) in list" :key="idx">
<div class="model-info">
<div class="model-name">
<strong>模型名称</strong>{{ it.mxmc }}
</div>
<div class="model-type flex">
<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="">
</div>
<div class="model-actions">
<span class="action-btn action-btn-view" @click.stop="openAddRule('', it)">
<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>编辑
</span>
<span class="action-btn action-btn-edit" @click.stop="openAddModel('detail', 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>删除
</span>
</div>
</li>
<div class="ww100 flex just-center">
<div class="empty-container">
<MOSTY.Empty :show="!loading && list.length <= 0"></MOSTY.Empty>
</div>
<div class="tc ww100 mb4" style="color: #a29f9f;" v-if="total == list.length && total > 0">暂时没有数据了</div>
<div class="no-more-data" v-if="total == list.length && total > 0">暂时没有数据了</div>
</ul>
</div>
<AddModel ref="addModel" />
<Regulation ref="regulation" />
<AddModel ref="addModel" :dict="{ D_MXGL_MXLX }" @getLits="getLits" />
</template>
<script setup>
import PageTitle from "@/components/aboutTable/PageTitle.vue";
import { getPageList, deleteEntity } from '@/api/model.js'
import emitter from "@/utils/eventBus.js";
import { CirclePlus } from '@element-plus/icons-vue'
import * as MOSTY from "@/components/MyComponents/index";
import Search from "@/components/aboutTable/Search.vue";
import { qcckPost } from "@/api/qcckApi.js";
import { reactive, ref, onMounted, getCurrentInstance, watch, defineEmits } from "vue";
import AddModel from "./addModel.vue";
import Regulation from "./regulation.vue";
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 searchBox = ref(); //搜索框
const show = ref(false)
const listHeight = ref()
const SSYJ = '02'
const YJGZ='01'
const searchConfiger = ref([
{ label: "模型名称", prop: "ypMc", placeholder: "请输入模型名称", showType: "input" },
{ label: "模型类型", prop: "ypLx", placeholder: "请输入模型类型", showType: "input" },
{ label: "模型名称", prop: "mxmc", placeholder: "请输入模型名称", showType: "input" },
{
label: "模型类型",
prop: "mxlx",
placeholder: "请选择模型类型",
showType: "select",
options: D_MXGL_MXLX
},
]);
const PaginationConfig = reactive({
pageCurrent: 1,
@ -86,7 +110,7 @@ const getLits = () => {
}
loading.value = true;
qcckPost(params, '/mosty-gsxt/tsyp/selectPage').then(res => {
getPageList(params).then(res => {
let arr = res.records || [];
list.value = PaginationConfig.pageCurrent == 1 ? arr : list.value.concat(arr);
total.value = res.total;
@ -105,16 +129,44 @@ const tabHeightFn = () => {
tabHeightFn();
};
};
const delDictItem = (id) => {
proxy.$confirm('是否删除该模型, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteEntity({ ids: [id] }).then(res => {
proxy.$message.success("删除成功!")
getLits()
})
}).catch(() => {
proxy.$message({
type: 'info',
message: '已取消删除'
});
});
}
// 打开弹窗
const addModel = ref(null)
const openAddModel = (type, row) => {
addModel.value.init(type, row)
}
// 打开规则弹窗
const regulation = ref(null)
const openAddRule = (type, row) => {
regulation.value.init(type, row)
switch (row.mxlx) {
case SSYJ:
emitter.emit('changeModel', {row,name:'四色预警规则'})
break;
case YJGZ:
emitter.emit('changeModel', {row,name:'预警规则'})
break;
default:
break;
}
}
const openYjList = (row) => {
emitter.emit('changeModel', {row,name:'预警列表'})
}
</script>
@ -124,7 +176,7 @@ const openAddRule = (type, row) => {
height: 100%;
margin-top: 20px;
margin-left: 10px;
border-radius: 4px;
border-radius: 8px;
box-sizing: border-box;
.btnsBox {
@ -138,29 +190,134 @@ const openAddRule = (type, row) => {
display: flex;
flex-wrap: wrap;
align-content: start;
gap: 18px;
gap: 20px;
overflow: hidden;
overflow-y: auto;
background: #fff;
padding: 4px;
padding: 16px;
box-sizing: border-box;
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.cntItem {
width: 300px;
border: 1px solid #ccc;
color: #787878;
border-radius: 4px;
overflow: hidden;
// 模型卡片样式
.model-card {
width: 300px;
border: 1px solid #e4e7ed;
border-radius: 8px;
overflow: hidden;
background: #fff;
transition: all 0.3s ease;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
.foot {
text-align: right;
margin-top: 4px;
border-top: 1px solid #ccc;
padding: 4px;
box-sizing: border-box;
&:hover {
transform: translateY(-4px);
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
border-color: #409eff;
}
// 模型信息区域
.model-info {
padding: 16px;
background-color: #fafafa;
border-bottom: 1px solid #f0f0f0;
.model-name,
.model-type {
margin-bottom: 8px;
font-size: 14px;
color: #606266;
strong {
color: #303133;
font-weight: 500;
}
}
.model-type {
margin-bottom: 0;
}
}
// 模型图片区域
.model-image-container {
cursor: pointer;
overflow: hidden;
transition: all 0.3s ease;
.model-image {
width: 100%;
height: 168px;
object-fit: cover;
transition: transform 0.3s ease;
&:hover {
transform: scale(1.05);
}
}
}
// 操作按钮区域
.model-actions {
text-align: right;
padding: 12px 0px;
border-top: 1px solid #f0f0f0;
background-color: #fafafa;
.action-btn {
// margin-left: 12px;
justify-content: space-between;
font-size: 13px;
cursor: pointer;
transition: all 0.3s ease;
display: inline-flex;
align-items: center;
padding: 4px 8px;
border-radius: 4px;
.action-icon {
margin-right: 4px;
font-size: 14px;
}
&:hover {
opacity: 0.8;
}
}
.action-btn-view,
.action-btn-edit {
color: #409eff;
&:hover {
background-color: #ecf5ff;
}
}
.action-btn-delete {
color: #f4ac47;
&:hover {
background-color: #fff7e6;
}
}
}
}
// 空状态和无更多数据样式
.empty-container {
width: 100%;
display: flex;
justify-content: center;
padding: 40px 0;
}
.no-more-data {
width: 100%;
text-align: center;
margin-bottom: 16px;
color: #a29f9f;
font-size: 13px;
}
}
</style>