This commit is contained in:
linfso 2023-12-13 00:26:24 +08:00
parent 08c81053bd
commit eed0cabdb7
5 changed files with 329 additions and 479 deletions

View File

@ -13,7 +13,7 @@
<!-- <el-tooltip class="item" effect="dark" content="导出" placement="top" v-if="download!=null"> <!-- <el-tooltip class="item" effect="dark" content="导出" placement="top" v-if="download!=null">
<el-button size="mini" circle icon="el-icon-download" @click="download()" /> <el-button size="mini" circle icon="el-icon-download" @click="download()" />
</el-tooltip> --> </el-tooltip> -->
<el-tooltip class="item" effect="dark" content="显隐列" placement="top" v-if="columns!=undefined"> <!-- <el-tooltip class="item" effect="dark" content="显隐列" placement="top" v-if="columns!=undefined">
<el-dropdown trigger="click" :hide-on-click="false" style="padding-left: 12px"> <el-dropdown trigger="click" :hide-on-click="false" style="padding-left: 12px">
<el-button size="mini" circle icon="el-icon-menu"/> <el-button size="mini" circle icon="el-icon-menu"/>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
@ -22,7 +22,7 @@
</template> </template>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</el-tooltip> </el-tooltip> -->
</el-row> </el-row>
<el-dialog :title="title" :visible.sync="open" append-to-body> <el-dialog :title="title" :visible.sync="open" append-to-body>

View File

@ -3,7 +3,6 @@
<!-- <logo v-if="showLogo" :collapse="isCollapse" /> --> <!-- <logo v-if="showLogo" :collapse="isCollapse" /> -->
<!-- <el-scrollbar :class="settings.sideTheme" wrap-class="scrollbar-wrapper"> --> <!-- <el-scrollbar :class="settings.sideTheme" wrap-class="scrollbar-wrapper"> -->
<div > <div >
<!-- v-if="isShowBizNav" -->
<biz-nav id="bizNav" v-if="this.sidebar.opened" style="padding: 0px 0px;width:100%"/> <biz-nav id="bizNav" v-if="this.sidebar.opened" style="padding: 0px 0px;width:100%"/>
<el-menu <el-menu
:default-active="activeMenu" :default-active="activeMenu"
@ -26,7 +25,6 @@
<hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" /> <hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
</div> </div>
</div> </div>
<!-- </el-scrollbar> --> <!-- </el-scrollbar> -->
</div> </div>
</template> </template>

View File

@ -18,14 +18,14 @@ const mutations = {
}, },
ADD_VISITED_VIEW: (state, view) => { ADD_VISITED_VIEW: (state, view) => {
// console.log(view) // console.log(view)
var addActionLogData = { // var addActionLogData = {
title: view.meta.title, // title: view.meta.title,
path: view.path, // path: view.path,
menuId: view.meta.menuId, // menuId: view.meta.menuId,
navPath: "", // navPath: "",
groupName: "", // groupName: "",
}; // };
addActionLog(addActionLogData); // addActionLog(addActionLogData);
if (state.visitedViews.some(v => v.path === view.path)) return if (state.visitedViews.some(v => v.path === view.path)) return
state.visitedViews.push( state.visitedViews.push(

View File

@ -13,8 +13,8 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="洲代码(段码使用)" prop="code"> <el-form-item label="洲代码" prop="code">
<el-input v-model="form.code" placeholder="请输入洲代码(段码使用)" /> <el-input v-model="form.code" placeholder="请输入洲代码" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
@ -32,25 +32,6 @@
<el-input v-model="form.remark" placeholder="请输入备注" /> <el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24">
<el-form-item label="删除标志(0代表存在" prop="delFlag">
<el-input v-model="form.delFlag" placeholder="请输入删除标志(0代表存在" />
</el-form-item>
</el-col>
<el-form-item label="上级字典">
<treeselect
ref="tree"
v-model="form.parentId"
:options="emisContinentOptions"
:normalizer="normalizer"
:default-expand-level="1"
:show-count="true"
placeholder="选择上级"
/>
</el-form-item>
</el-form> </el-form>
</el-row> </el-row>
<div style="text-align: center;margin-bottom: 10px;"> <div style="text-align: center;margin-bottom: 10px;">
@ -110,7 +91,6 @@ export default {
this.loading = false; this.loading = false;
}); });
} }
this.getTreeselect();
}, },
// 取消按钮 // 取消按钮
cancel() { cancel() {
@ -154,32 +134,7 @@ export default {
} }
}); });
}, },
/** 转换菜单数据结构 */
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children;
}
return {
id: node.id,
label: node.idName,
children: node.children
};
},
/** 查询菜单下拉树结构 */
getTreeselect() {
const queryParams = {}
listEmisContinent(queryParams).then(response => {
this.emisContinentOptions = [];
const rootItem = { idId: 0, emisContinentName: '-', children: [] };
rootItem.children = this.handleTree(response.data, "id");
this.emisContinentOptions.push(rootItem);
if(this.parentId != undefined) {
this.form.parentId = this.parentId;
}
});
},
} }
}; };
</script> </script>

View File

@ -2,12 +2,13 @@
<div class="app-container"> <div class="app-container">
<el-row :gutter="20" type='flex'> <el-row :gutter="20" type='flex'>
<el-col :span="4" :xs="4"> <el-col :span="4" :xs="4">
<div class="head-container"> <div class="head-container">
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="15" :xs="15"> <el-col :span="15" :xs="15">
<el-input <el-input
v-model="domainName" v-model="continentName"
placeholder="全球大区" placeholder=""
clearable clearable
size="small" size="small"
prefix-icon="el-icon-search" prefix-icon="el-icon-search"
@ -16,22 +17,20 @@
</el-col> </el-col>
<el-col :span="4" :xs="4"> <el-col :span="4" :xs="4">
<el-button <el-button
style="margin-left: 2px; width: 33px;height:33px;border:1px solid #eeeeee; padding: 0px;line-height:23px;text-align:center;border-radius:0px;margin-top:1px;" type="normal"
circle size="mini"
type="text"
size="medium"
icon="el-icon-plus" icon="el-icon-plus"
:disabled="false" :disabled="false"
@click="handleContinentAdd" @click="handleContinentAdd"
v-hasPermi="['emis:emisContinent:add']" v-hasPermi="['emis:emisContinent:add']">
>
</el-button> </el-button>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
<div class="head-container"> <div class="head-container">
<el-tree <el-tree
:data="domainIdsTree" :data="continentIdsTree"
:props="defaultProps" :props="defaultProps"
:expand-on-click-node="false" :expand-on-click-node="false"
:filter-node-method="filterNode" :filter-node-method="filterNode"
@ -41,10 +40,8 @@
highlight-current highlight-current
@node-click="handleNodeClick" @node-click="handleNodeClick"
/> />
<!-- default-expand-all --> <div slot-scope="{ node, data }" @mouseenter="mouseenter(data)" @mouseleave="mouseleave(data)" style="width:100%">
<span slot-scope="{ node, data }" @mouseenter="mouseenter(data)" @mouseleave="mouseleave(data)" style="width:100%">
<template> <template>
<!-- <svg-icon v-if="data.children != undefined" icon-class="category" style="width:13px;color: #909399;margin-right: 2px;"/> -->
<svg-icon icon-class="dict" style="width:13px;color: #505050;margin-right:2px;"/> <svg-icon icon-class="dict" style="width:13px;color: #505050;margin-right:2px;"/>
<span style="font-size:13px">{{ data.label }}</span> <span style="font-size:13px">{{ data.label }}</span>
<span v-show="data.show" style="margin-left: 10px;"> <span v-show="data.show" style="margin-left: 10px;">
@ -55,7 +52,7 @@
size="medium" size="medium"
:disabled="false" :disabled="false"
icon="el-icon-edit" icon="el-icon-edit"
@click="() => handleUpdateDictType(data)" @click="() => handleUpdateContinent(data)"
> >
</el-button> </el-button>
<el-button <el-button
@ -64,14 +61,15 @@
size="mini" size="mini"
icon="el-icon-delete" icon="el-icon-delete"
style="padding: 1px; width: 1px; margin-left: 5px" style="padding: 1px; width: 1px; margin-left: 5px"
@click="() => handleDeleteDictType(data)" @click="() => handleDeleteContinent(data)"
> >
</el-button> </el-button>
</span> </span>
</template> </template>
</span> </div>
</el-tree> </el-tree>
</div> </div>
</el-col> </el-col>
<el-col :span="20" :xs="20" style="border-left:1px solid rgb(248 249 251);"> <el-col :span="20" :xs="20" style="border-left:1px solid rgb(248 249 251);">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
@ -99,23 +97,6 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="" prop="twoCode">
<el-input
v-model="queryParams.twoCode"
placeholder="二字码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="" prop="threeCode">
<el-input
v-model="queryParams.threeCode"
placeholder="三字码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@ -168,6 +149,7 @@
</el-col> --> </el-col> -->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="emisCountryList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="emisCountryList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="国家名称" align="left" prop="name" min-width="100"> <el-table-column label="国家名称" align="left" prop="name" min-width="100">
@ -200,8 +182,6 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="total>0" v-show="total>0"
:total="total" :total="total"
@ -211,6 +191,9 @@
:page-size="queryParams.pageSize" :page-size="queryParams.pageSize"
@pagination="getList" @pagination="getList"
/> />
</el-col>
</el-row>
<!-- 添加或修改国家对话框 --> <!-- 添加或修改国家对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" :close-on-click-modal="false" append-to-body> <el-dialog :title="title" :visible.sync="open" width="500px" :close-on-click-modal="false" append-to-body>
<el-row :gutter="0"> <el-row :gutter="0">
@ -258,14 +241,6 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<!--
<el-col :span="24" v-show="moreInputVisible" > </el-col>
<el-col :span="24">
<el-divider content-position="right" @click="handleShowMoreInput" >更多信息[+]</el-divider>
</el-col>
-->
</el-form> </el-form>
</el-row> </el-row>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
@ -275,89 +250,38 @@
</el-dialog> </el-dialog>
<!-- 添加或修改地球洲对话框 --> <!-- 添加或修改地球洲对话框 -->
<el-dialog :title="title" :visible.sync="openc" width="500px" :close-on-click-modal="false" append-to-body>
<el-row :gutter="0">
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-col :span="24">
<el-form-item label="洲名称" prop="name">
<el-input v-model="form.name" placeholder="请输入洲名称" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="英文名称" prop="nameEn">
<el-input v-model="form.nameEn" placeholder="请输入英文名称" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="洲代码" prop="code">
<el-input v-model="form.code" placeholder="请输入洲代码" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-col>
<!--
<el-col :span="24" v-show="moreInputVisible" > </el-col>
<el-col :span="24">
<el-divider content-position="right" @click="handleShowMoreInput" >更多信息[+]</el-divider>
</el-col>
-->
</el-form>
</el-row>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitContinentForm">确 定</el-button>
<el-button @click="cancelContinent">取 消</el-button>
</div>
</el-dialog>
<el-dialog :title="titleForm" :visible.sync="openForm" width="500px" append-to-body> <el-dialog :title="titleForm" :visible.sync="openForm" width="500px" append-to-body>
<emisCountryForm :id="currentId" @on-changed="handleFormChanged" @on-cancel="cancelForm"></EmisCountryForm> <emisContinentForm :id="currentContinentId" @on-changed="handleFormChanged" @on-cancel="cancelForm"></EmisContinentForm>
</el-dialog> </el-dialog>
<el-dialog :title="titleView" :visible.sync="openView" width="60%" :close-on-click-modal="false" append-to-body>
<emisCountryView :id="id" ></EmisCountryView>
</el-dialog>
</el-col>
</el-row>
</div> </div>
</template> </template>
<script> <script>
import { listEmisCountry, getEmisCountry, delEmisCountry, addEmisCountry, updateEmisCountry } from "@/api/emis/emisCountry"; import { listEmisCountry, getEmisCountry, delEmisCountry, addEmisCountry, updateEmisCountry } from "@/api/emis/emisCountry";
import { listEmisContinent, getEmisContinent, delEmisContinent, addEmisContinent, updateEmisContinent } from "@/api/emis/emisContinent"; import { listEmisContinent, getEmisContinent, delEmisContinent, addEmisContinent, updateEmisContinent } from "@/api/emis/emisContinent";
import elDateSimplePicker from '@/components/DatePickerAdv/elDateSimplePicker'; import elDateSimplePicker from '@/components/DatePickerAdv/elDateSimplePicker';
import emisCountryView from '@/views/emis/emisCountry/emisCountryView'; import emisCountryView from '@/views/emis/emisCountry/emisCountryView';
import emisCountryForm from '@/views/emis/emisCountry/emisCountryForm'; import emisCountryForm from '@/views/emis/emisCountry/emisCountryForm';
import emisContinentView from '@/views/emis/emisContinent/emisContinentView';
import emisContinentForm from '@/views/emis/emisContinent/emisContinentForm'; import emisContinentForm from '@/views/emis/emisContinent/emisContinentForm';
export default { export default {
name: "emisCountry", name: "emisCountry",
components: { elDateSimplePicker,emisCountryView,emisCountryForm,emisContinentView,emisContinentForm }, components: { elDateSimplePicker,emisContinentForm},
dicts: [ dicts: [
], ],
data() { data() {
return { return {
domainName:"",
domainIdsTree:[],
domainIdsOptions:[],
domainIdsEditOptions:[],
domainIdMap: new Map(),
continentName:"",
continentIdsTree:[],
continentIdsOptions:[], continentIdsOptions:[],
currentContinentId:-1,
defaultProps: { defaultProps: {
children: "children", children: "children",
label: "label" label: "label"
}, },
domainSelectList:[],
// 遮罩层 // 遮罩层
loading: true, loading: true,
// 选中数组 // 选中数组
@ -378,7 +302,7 @@ export default {
title: "", title: "",
// 是否显示弹出层 // 是否显示弹出层
open: false, open: false,
openc: false,
openForm: false, openForm: false,
titleForm: "", titleForm: "",
@ -415,26 +339,26 @@ export default {
id: [ id: [
{ required: true, message: "国家序号不能为空", trigger: "blur" } { required: true, message: "国家序号不能为空", trigger: "blur" }
], ],
continentId: [
{ required: true, message: "所属洲id不能为空", trigger: "change" }
],
} }
}; };
}, },
created() { created() {
this.getList();
this.getContinentList(); this.getContinentList();
}, },
watch: {
// 根据名称筛选部门树
continentName(val) {
this.$refs.tree.filter(val);
}
},
methods: { methods: {
/** 查询国家列表 */ /** 查询国家列表 */
getList() { getList() {
this.loading = true; this.loading = true;
this.queryParams.params = {}; this.queryParams.params = {};
if (null != this.daterangeCreateTime && '' != this.daterangeCreateTime) {
this.queryParams.params["beginCreateTime"] = this.daterangeCreateTime[0];
this.queryParams.params["endCreateTime"] = this.daterangeCreateTime[1];
}
if (null != this.daterangeUpdateTime && '' != this.daterangeUpdateTime) {
this.queryParams.params["beginUpdateTime"] = this.daterangeUpdateTime[0];
this.queryParams.params["endUpdateTime"] = this.daterangeUpdateTime[1];
}
listEmisCountry(this.addDateRange(this.queryParams, this.dateTimeRange)).then(response => { listEmisCountry(this.addDateRange(this.queryParams, this.dateTimeRange)).then(response => {
this.emisCountryList = response.rows; this.emisCountryList = response.rows;
this.total = response.total; this.total = response.total;
@ -444,71 +368,47 @@ export default {
getContinentList() { getContinentList() {
this.loading = true; this.loading = true;
this.queryParams.params = {}; this.queryParams.params = {};
this.continentIdsOptions =[]; this.continentIdsOptions =[];
listEmisContinent(this.addDateRange(this.queryParams, this.dateTimeRange)).then(response => { var qParam = {};
listEmisContinent(qParam).then(response => {
this.loading = false; this.loading = false;
this.domainIdsTree = []; this.continentIdsTree = [];
var domainTree={"id":"","label":"所属大区","children":[]}; this.continentIdsOptions = [];
// domainTree.children.push({"id":"-1","label":"临时"}); var continentTree={"id":"","label":"所属大区","children":[]};
//this.domainIdMap[-1]="临时"; var lastContinentId = -1;
var lastDomainId = -1;
response.rows.forEach(item =>{ response.rows.forEach(item =>{
var optItem={value:item.id,label:item.name}; var optItem={value:item.id,label:item.name};
this.continentIdsOptions.push(optItem) this.continentIdsOptions.push(optItem)
var treeItem={"id":item.id,"label":item.name}; var treeItem={"id":item.id,"label":item.name,"show":false};
domainTree.children.push(treeItem); continentTree.children.push(treeItem);
lastDomainId = item.id; lastContinentId = item.id;
}); });
this.queryParams.continentId = lastContinentId;
var cacheDomainId = this.getCacheDomainId(); this.continentIdsTree.push(continentTree);
if (cacheDomainId == undefined || cacheDomainId== -1){ this.getList();
cacheDomainId = lastDomainId;
this.saveCacheDomainId(lastDomainId);
}
this.queryParams.continentId = cacheDomainId;
this.domainIdsTree.push(domainTree);
//this.getList();
}); });
},
mouseenter(data) {
this.$set(data, 'show', true)
},
mouseleave(data) {
this.$set(data, 'show', false)
},
// 节点单击事件
handleNodeClick(data) {
// if(data.id!="-1"){
this.queryParams.continentId = data.id;
this.form.continentId= data.id;
this.saveCacheDomainId(data.id);
// this.currentAppName=data.label;
this.handleQuery();
// }
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleContinentAdd(row) { handleContinentAdd(row) {
this.reset(); this.reset();
this.openc = true; this.openForm = true;
this.title = "新增"; this.titleForm = "新增";
}, },
handleUpdateDictType(data) { handleUpdateContinent(row){
this.currentDictId = data.id || this.ids; this.currentContinentId = row.id || this.ids;
this.openDictType = true; this.openForm = true;
this.titleDictType = "修改区域"; this.titleForm = "修改";
}, },
handleDeleteDictType(data) { handleDeleteContinent(row){
console.log(data) const ids = row.id || this.ids;
const dictIds = data.id || this.ids; this.$modal.confirm('是否确认删除').then(function() {
this.$modal.confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?').then(function() { return delEmisContinent(ids);
return delEmisContinent(dictIds);
}).then(() => { }).then(() => {
console.log("删除成功") this.getContinentList()
this.getContinentList();
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
}).catch(() => {}); }).catch(() => {});
}, },
@ -532,33 +432,29 @@ export default {
} }
}); });
}, },
saveCacheDomainId(continentId){ // 筛选节点
var jObj = { filterNode(value, data) {
continentId: continentId if (!value) return true;
}; return data.label.indexOf(value) !== -1;
this.$cache.local.setJSON("continentId",jObj);
}, },
getCacheDomainId(){ // 节点单击事件
try{ handleNodeClick(data) {
var domainJsonObj = this.$cache.local.getJSON("continentId"); this.queryParams.continentId = data.id;
if(domainJsonObj != undefined){ this.form.continentId= data.id;
return domainJsonObj.continentId; this.handleQuery();
}else{ },
return -1; mouseenter(data) {
} console.log("111"+data);
}catch(e){ this.$set(data, 'show', true)
this.$cache.local.remove("continentId"); },
} mouseleave(data) {
console.log("222"+data);
this.$set(data, 'show', false)
}, },
// 取消按钮 // 取消按钮
cancel() { cancel() {
this.open = false; this.open = false;
this.reset(); this.reset();
},
// 取消按钮
cancelContinent() {
this.openc = false;
this.reset();
}, },
// 表单重置 // 表单重置
reset() { reset() {
@ -628,6 +524,7 @@ export default {
// this.titleEmisCountry = "修改"; // this.titleEmisCountry = "修改";
}, },
handleView(row) { handleView(row) {
this.id=row.id; this.id=row.id;
this.titleView="查看"; this.titleView="查看";
@ -655,11 +552,11 @@ export default {
}); });
}, },
handleFormChanged(){ handleFormChanged(){
this.openForm = false; this.openc = false;
this.getList(); this.getContinentList();
}, },
cancelForm(){ cancelForm(){
this.openForm = false; this.openc = false;
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {