修复区域选择

dongdingding
许宏杰 2 years ago
parent 2dda26067c
commit 61c4d46279

@ -1,9 +1,9 @@
import Vue from 'vue' import Vue from "vue";
import Cookies from 'js-cookie' import Cookies from "js-cookie";
import Element from 'element-ui' import Element from "element-ui";
import './assets/styles/element-variables.scss' import "./assets/styles/element-variables.scss";
Element.Dialog.props.closeOnClickModal.default = false; //模态框单击空白处不允许关闭 Element.Dialog.props.closeOnClickModal.default = false; //模态框单击空白处不允许关闭
// 带有斑马纹 // 带有斑马纹
// Element.Table.props.stripe = { // Element.Table.props.stripe = {
@ -18,64 +18,74 @@ Element.Table.props.border = {
}; };
import "@/utils/rem.js"; //计算rem基准 import "@/utils/rem.js"; //计算rem基准
import '@/assets/styles/index.scss' // global css import { filterTown } from "@/utils/myselfFu.js";
import '@/assets/styles/ruoyi.scss' // ruoyi css Vue.prototype.$filterTown = filterTown;
import App from './App'
import store from './store'
import router from './router'
import directive from './directive' // directive
import plugins from './plugins' // plugins
import { download } from '@/utils/request'
import './assets/icons' // icon import "@/assets/styles/index.scss"; // global css
import './permission' // permission control import "@/assets/styles/ruoyi.scss"; // ruoyi css
import App from "./App";
import store from "./store";
import router from "./router";
import directive from "./directive"; // directive
import plugins from "./plugins"; // plugins
import { download } from "@/utils/request";
import "./assets/icons"; // icon
import "./permission"; // permission control
import { getDicts } from "@/api/system/dict/data"; import { getDicts } from "@/api/system/dict/data";
import { getConfigKey } from "@/api/system/config"; import { getConfigKey } from "@/api/system/config";
import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree } from "@/utils/ruoyi"; import {
parseTime,
resetForm,
addDateRange,
selectDictLabel,
selectDictLabels,
handleTree,
} from "@/utils/ruoyi";
// 分页组件 // 分页组件
import Pagination from "@/components/Pagination"; import Pagination from "@/components/Pagination";
// 自定义表格工具组件 // 自定义表格工具组件
import RightToolbar from "@/components/RightToolbar" import RightToolbar from "@/components/RightToolbar";
// 富文本组件 // 富文本组件
import Editor from "@/components/Editor" import Editor from "@/components/Editor";
// 文件上传组件 // 文件上传组件
import FileUpload from "@/components/FileUpload" import FileUpload from "@/components/FileUpload";
// 图片上传组件 // 图片上传组件
import ImageUpload from "@/components/ImageUpload" import ImageUpload from "@/components/ImageUpload";
// 图片预览组件 // 图片预览组件
import ImagePreview from "@/components/ImagePreview" import ImagePreview from "@/components/ImagePreview";
// 字典标签组件 // 字典标签组件
import DictTag from '@/components/DictTag' import DictTag from "@/components/DictTag";
// 头部标签组件 // 头部标签组件
import VueMeta from 'vue-meta' import VueMeta from "vue-meta";
// 字典数据组件 // 字典数据组件
import DictData from '@/components/DictData' import DictData from "@/components/DictData";
// 全局方法挂载 // 全局方法挂载
Vue.prototype.getDicts = getDicts Vue.prototype.getDicts = getDicts;
Vue.prototype.getConfigKey = getConfigKey Vue.prototype.getConfigKey = getConfigKey;
Vue.prototype.parseTime = parseTime Vue.prototype.parseTime = parseTime;
Vue.prototype.resetForm = resetForm Vue.prototype.resetForm = resetForm;
Vue.prototype.addDateRange = addDateRange Vue.prototype.addDateRange = addDateRange;
Vue.prototype.selectDictLabel = selectDictLabel Vue.prototype.selectDictLabel = selectDictLabel;
Vue.prototype.selectDictLabels = selectDictLabels Vue.prototype.selectDictLabels = selectDictLabels;
Vue.prototype.download = download Vue.prototype.download = download;
Vue.prototype.handleTree = handleTree Vue.prototype.handleTree = handleTree;
// 全局组件挂载 // 全局组件挂载
Vue.component('DictTag', DictTag) Vue.component("DictTag", DictTag);
Vue.component('Pagination', Pagination) Vue.component("Pagination", Pagination);
Vue.component('RightToolbar', RightToolbar) Vue.component("RightToolbar", RightToolbar);
Vue.component('Editor', Editor) Vue.component("Editor", Editor);
Vue.component('FileUpload', FileUpload) Vue.component("FileUpload", FileUpload);
Vue.component('ImageUpload', ImageUpload) Vue.component("ImageUpload", ImageUpload);
Vue.component('ImagePreview', ImagePreview) Vue.component("ImagePreview", ImagePreview);
Vue.use(directive) Vue.use(directive);
Vue.use(plugins) Vue.use(plugins);
Vue.use(VueMeta) Vue.use(VueMeta);
DictData.install() DictData.install();
/** /**
* If you don't want to use mock-server * If you don't want to use mock-server
@ -87,14 +97,14 @@ DictData.install()
*/ */
Vue.use(Element, { Vue.use(Element, {
size: Cookies.get('size') || 'medium' // set element-ui default size size: Cookies.get("size") || "medium", // set element-ui default size
}) });
Vue.config.productionTip = false Vue.config.productionTip = false;
new Vue({ new Vue({
el: '#app', el: "#app",
router, router,
store, store,
render: h => h(App) render: (h) => h(App),
}) });

@ -0,0 +1,12 @@
import store from "@/store";
// 翻译区域id
export function filterTown(id) {
if (id == undefined) return;
let name = store.getters.townList.filter((item) => item.value == id);
if (name.length > 0) {
return name[0].label;
} else {
return id;
}
}

@ -269,8 +269,8 @@
border border
labelClassName="desLable" labelClassName="desLable"
> >
<el-descriptions-item label="区域id">{{ <el-descriptions-item label="区域">{{
form.areaId $filterTown(form.areaId)
}}</el-descriptions-item> }}</el-descriptions-item>
<el-descriptions-item label="来源类型"> <el-descriptions-item label="来源类型">

@ -169,8 +169,15 @@
label-width="auto" label-width="auto"
class="dialog-from" class="dialog-from"
> >
<el-form-item label="区域id" prop="areaId"> <el-form-item label="区域" prop="areaId">
<el-input v-model="form.areaId" placeholder="请输入区域id" /> <el-select v-model="form.areaId" placeholder="请选择区域" filterable>
<el-option
v-for="dict in townList"
:key="dict.value"
:label="dict.label"
:value="parseInt(dict.value)"
></el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="攻击发起时间" prop="attackTime"> <el-form-item label="攻击发起时间" prop="attackTime">
<el-date-picker <el-date-picker
@ -274,8 +281,8 @@
border border
labelClassName="desLable" labelClassName="desLable"
> >
<el-descriptions-item label="区域id">{{ <el-descriptions-item label="区域">{{
form.areaId $filterTown(form.areaId)
}}</el-descriptions-item> }}</el-descriptions-item>
<el-descriptions-item label="攻击发起时间">{{ <el-descriptions-item label="攻击发起时间">{{
@ -345,6 +352,7 @@
</template> </template>
<script> <script>
import { mapGetters } from "vuex";
import { import {
listDetection, listDetection,
getDetection, getDetection,
@ -355,6 +363,9 @@ import {
} from "@/api/zongzhi/netSecurity/SecurityCheck/index.js"; } from "@/api/zongzhi/netSecurity/SecurityCheck/index.js";
export default { export default {
name: "Detection", name: "Detection",
computed: {
...mapGetters(["townList"]),
},
// //
dicts: ["tc_net_safety_level", "tc_attack_type"], dicts: ["tc_net_safety_level", "tc_attack_type"],
data() { data() {

@ -170,8 +170,15 @@
label-width="auto" label-width="auto"
class="dialog-from" class="dialog-from"
> >
<el-form-item label="区域id" prop="areaId"> <el-form-item label="区域" prop="areaId">
<el-input v-model="form.areaId" placeholder="请输入区域id" /> <el-select v-model="form.areaId" placeholder="请选择区域" filterable>
<el-option
v-for="dict in townList"
:key="dict.value"
:label="dict.label"
:value="parseInt(dict.value)"
></el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="系统名称" prop="steamName"> <el-form-item label="系统名称" prop="steamName">
<el-input v-model="form.steamName" placeholder="请输入系统名称" /> <el-input v-model="form.steamName" placeholder="请输入系统名称" />
@ -302,8 +309,8 @@
border border
labelClassName="desLable" labelClassName="desLable"
> >
<el-descriptions-item label="区域id">{{ <el-descriptions-item label="区域">{{
form.areaId $filterTown(form.areaId)
}}</el-descriptions-item> }}</el-descriptions-item>
<el-descriptions-item label="系统名称">{{ <el-descriptions-item label="系统名称">{{
@ -379,6 +386,7 @@
</template> </template>
<script> <script>
import { mapGetters } from "vuex";
import { import {
listSystem, listSystem,
getSystem, getSystem,
@ -387,10 +395,14 @@ import {
updateSystem, updateSystem,
exportSystem, exportSystem,
} from "@/api/zongzhi/netSecurity/supervise/DbSteam/index.js"; } from "@/api/zongzhi/netSecurity/supervise/DbSteam/index.js";
export default { export default {
name: "Detection", name: "Detection",
// //
dicts: ["tc_yes_no", "tc_net_safety_level", "tc_db_steam_state"], dicts: ["tc_yes_no", "tc_net_safety_level", "tc_db_steam_state"],
computed: {
...mapGetters(["townList"]),
},
data() { data() {
return { return {
tableHeigth: 0, tableHeigth: 0,

Loading…
Cancel
Save