更改发布任务

lijinlong
李劲龙 1 year ago
parent 4694a94d9b
commit beccaa030e

@ -1,10 +1,10 @@
import Vue from 'vue'
import Router from 'vue-router'
import Vue from "vue";
import Router from "vue-router";
Vue.use(Router)
Vue.use(Router);
/* Layout */
import Layout from '@/layout'
import Layout from "@/layout";
/**
* Note: 路由配置项
@ -31,153 +31,168 @@ import Layout from '@/layout'
// 公共路由
export const constantRoutes = [
{
path: '/redirect',
path: "/redirect",
component: Layout,
hidden: true,
children: [
{
path: '/redirect/:path(.*)',
component: () => import('@/views/redirect')
}
]
path: "/redirect/:path(.*)",
component: () => import("@/views/redirect"),
},
],
},
{
path: '/login',
component: () => import('@/views/login'),
hidden: true
path: "/login",
component: () => import("@/views/login"),
hidden: true,
},
{
path: '/register',
component: () => import('@/views/register'),
hidden: true
path: "/register",
component: () => import("@/views/register"),
hidden: true,
},
{
path: '/404',
component: () => import('@/views/error/404'),
hidden: true
path: "/404",
component: () => import("@/views/error/404"),
hidden: true,
},
{
path: '/401',
component: () => import('@/views/error/401'),
hidden: true
path: "/401",
component: () => import("@/views/error/401"),
hidden: true,
},
// {
// path: "",
// component: Layout,
// redirect: "index",
// children: [
// {
// path: "index",
// component: () => import("@/views/index"),
// name: "Index",
// meta: { title: "首页", icon: "dashboard", affix: true },
// },
// ],
// },
{
path: '',
path: "/user",
component: Layout,
redirect: 'index',
hidden: true,
redirect: "noredirect",
children: [
{
path: 'index',
component: () => import('@/views/index'),
name: 'Index',
meta: { title: '首页', icon: 'dashboard', affix: true }
}
]
path: "profile",
component: () => import("@/views/system/user/profile/index"),
name: "Profile",
meta: { title: "个人中心", icon: "user" },
},
],
},
{
path: '/user',
path: "",
component: Layout,
hidden: true,
redirect: 'noredirect',
redirect: "Zdgl",
children: [
{
path: 'profile',
component: () => import('@/views/system/user/profile/index'),
name: 'Profile',
meta: { title: '个人中心', icon: 'user' }
}
]
}
]
path: "/volunteer/zyzsjgl/zdgl/:dictId(\\d+)",
component: () => import("@/views/volunteer/zyzsjgl/zdgl/data"),
hidden: true,
name:"Zdgl",
meta: { title: "字典详情", icon: "dashboard", affix: true , activeMenu: "/volunteer/zyzsjgl/zdgl"},
},
],
},
];
// 动态路由,基于用户权限动态去加载
export const dynamicRoutes = [
{
path: '/system/user-auth',
path: "/system/user-auth",
component: Layout,
hidden: true,
permissions: ['system:user:edit'],
permissions: ["system:user:edit"],
children: [
{
path: 'role/:userId(\\d+)',
component: () => import('@/views/system/user/authRole'),
name: 'AuthRole',
meta: { title: '分配角色', activeMenu: '/system/user' }
}
]
path: "role/:userId(\\d+)",
component: () => import("@/views/system/user/authRole"),
name: "AuthRole",
meta: { title: "分配角色", activeMenu: "/system/user" },
},
],
},
{
path: '/system/role-auth',
path: "/system/role-auth",
component: Layout,
hidden: true,
permissions: ['system:role:edit'],
permissions: ["system:role:edit"],
children: [
{
path: 'user/:roleId(\\d+)',
component: () => import('@/views/system/role/authUser'),
name: 'AuthUser',
meta: { title: '分配用户', activeMenu: '/system/role' }
}
]
path: "user/:roleId(\\d+)",
component: () => import("@/views/system/role/authUser"),
name: "AuthUser",
meta: { title: "分配用户", activeMenu: "/system/role" },
},
],
},
{
path: '/system/dict-data',
path: "/system/dict-data",
component: Layout,
hidden: true,
permissions: ['system:dict:list'],
permissions: ["system:dict:list"],
children: [
{
path: 'index/:dictId(\\d+)',
component: () => import('@/views/system/dict/data'),
name: 'Data',
meta: { title: '字典数据', activeMenu: '/system/dict' }
}
]
path: "index/:dictId(\\d+)",
component: () => import("@/views/system/dict/data"),
name: "Data",
meta: { title: "字典数据", activeMenu: "/system/dict" },
},
],
},
{
path: '/monitor/job-log',
path: "/monitor/job-log",
component: Layout,
hidden: true,
permissions: ['monitor:job:list'],
permissions: ["monitor:job:list"],
children: [
{
path: 'index/:jobId(\\d+)',
component: () => import('@/views/monitor/job/log'),
name: 'JobLog',
meta: { title: '调度日志', activeMenu: '/monitor/job' }
}
]
path: "index/:jobId(\\d+)",
component: () => import("@/views/monitor/job/log"),
name: "JobLog",
meta: { title: "调度日志", activeMenu: "/monitor/job" },
},
],
},
{
path: '/tool/gen-edit',
path: "/tool/gen-edit",
component: Layout,
hidden: true,
permissions: ['tool:gen:edit'],
permissions: ["tool:gen:edit"],
children: [
{
path: 'index/:tableId(\\d+)',
component: () => import('@/views/tool/gen/editTable'),
name: 'GenEdit',
meta: { title: '修改生成配置', activeMenu: '/tool/gen' }
}
]
}
]
path: "index/:tableId(\\d+)",
component: () => import("@/views/tool/gen/editTable"),
name: "GenEdit",
meta: { title: "修改生成配置", activeMenu: "/tool/gen" },
},
],
},
];
// 防止连续点击多次路由报错
let routerPush = Router.prototype.push;
let routerReplace = Router.prototype.replace;
// push
Router.prototype.push = function push(location) {
return routerPush.call(this, location).catch(err => err)
}
return routerPush.call(this, location).catch((err) => err);
};
// replace
Router.prototype.replace = function push(location) {
return routerReplace.call(this, location).catch(err => err)
}
return routerReplace.call(this, location).catch((err) => err);
};
export default new Router({
// mode: 'history', // 去掉url中的#
scrollBehavior: () => ({ y: 0 }),
routes: constantRoutes
})
routes: constantRoutes,
});

@ -14,13 +14,10 @@
label="序号"
type="index"
header-align="center"
width="70">
</el-table-column>
<el-table-column
prop="content"
label="参与活动"
width="280"
width="70"
>
</el-table-column>
<el-table-column prop="content" label="参与活动" width="280">
<template slot-scope="scope">
<div class="activity">
<div>{{ scope.row.name }}</div>
@ -35,35 +32,25 @@
width="180"
>
</el-table-column>
<el-table-column
prop="duration"
label="服务时长"
>
</el-table-column>
<el-table-column
prop="address"
label="参加地址"
>
</el-table-column>
<el-table-column
prop="activityTime"
label="参加时间"
>
<el-table-column prop="duration" label="服务时长"> </el-table-column>
<el-table-column prop="address" label="参加地址"> </el-table-column>
<el-table-column prop="activityTime" label="参加时间">
<template slot-scope="scope">
<div>{{ scope.row.activityTime.split(' ')[0] }}</div>
<div>{{ scope.row.activityTime.split(" ")[0] }}</div>
</template>
</el-table-column>
<el-table-column
label="操作"
width="250"
>
<el-table-column label="操作" width="250">
<template slot-scope="scope">
<div class="tabs-btns">
<div class="look" @click="look(scope.row)">
<img src="@/assets/images/look.png" alt="">
<img src="@/assets/images/look.png" alt="" />
<span>查看</span>
</div>
<div class="look" @click="participation(scope.row)" v-if="scope.row.involveStaus == 2">
<div
class="look"
@click="participation(scope.row)"
v-if="scope.row.involveStaus == 2"
>
<!-- <img src="@/assets/images/look.png" alt=""> -->
<span>报名</span>
</div>
@ -96,7 +83,7 @@
</div>
<div class="itemE">
<div>活动时间:</div>
<div>{{ dialogContent.activityTime.split(' ')[0] }}</div>
<div>{{ dialogContent.activityTime.split(" ")[0] }}</div>
</div>
</div>
<div class="mainsEvents">
@ -117,7 +104,13 @@
<div class="itemE">
<div>活动标签:</div>
<div class="mainTag">
<div v-for="item in dialogContent.label">{{ item.name }}</div>
<div
v-show="item != ''"
v-for="(item, index) in dialogContent.label"
:key="index"
>
{{ item }}
</div>
</div>
</div>
</div>
@ -125,78 +118,90 @@
</div>
</template>
<script>
import myPagination from "@/views/components/myPagination/index.vue"
import myDialog from "@/views/components/dialog/index.vue"
import myPagination from "@/views/components/myPagination/index.vue";
import myDialog from "@/views/components/dialog/index.vue";
import { mapState } from "vuex";
import { Loading } from "element-ui";
export default {
components:{myPagination,myDialog},
components: { myPagination, myDialog },
data() {
return {
tableData: [],
pages:{
pageSize:10,
pageNum:1
pages: {
pageSize: 10,
pageNum: 1,
},
total:0,
loading:false,
input:{
name:""
total: 0,
loading: false,
input: {
name: "",
},
loadingTwo:false,
dialogContent:{
name:'',
content:'',
publisher:'',
activityTime:'',
address:'',
label:[]
}
}
loadingTwo: false,
dialogContent: {
name: "",
content: "",
publisher: "",
activityTime: "",
address: "",
label: [],
},
arr: [
"ageRange",
"sexRange",
"politicalRange",
"educationRange",
"housingRange",
"industryRange",
"interestRange",
"professionalRange",
"schoolRange",
"nationalityRange",
],
};
},
props:{
value:{
type:String,
default:''
}
props: {
value: {
type: String,
default: "",
},
},
watch:{
value:{
handler(newInput,oldInput) {
watch: {
value: {
handler(newInput, oldInput) {
//
this.input.name = newInput;
this.pages= {
this.pages = {
pageNum: 1,
pageSize: 10,
};
this.getList()
this.getList();
},
immediate:true,
}
immediate: true,
},
},
methods:{
methods: {
//
async getList(params){
async getList(params) {
this.loading = true;
if(params == '1') {
this.pages= {
if (params == "1") {
this.pages = {
pageNum: 1,
pageSize: 10,
};
this.input.name = '';
this.input.name = "";
}
let obj = { ...this.pages,...this.input }
let obj = { ...this.pages, ...this.input };
let data = await this.$api.huodongtuijian.list(obj);
if(data.code == 200) {
if (data.code == 200) {
this.loading = false;
this.tableData = data.rows;
this.total = data.total;
}
},
//
pagesChange(pages){
pagesChange(pages) {
// console.log(pages)
this.getList(pages)
this.getList(pages);
},
// tabsclass
tableRowClassName({ row, rowIndex }) {
@ -210,59 +215,69 @@ export default {
if (columnIndex === 0) {
return `text-align:center`;
} else {
return '';
return "";
}
},
//
async look(row){
this.$refs.chakan.open();
//
labelgenerate(data = {}) {
let arrlist = [];
for (let key3 of this.arr) {
for (let key4 in data) {
if (key3 == key4) {
let a = data[key3];
arrlist.push(a);
}
}
}
return arrlist;
},
async look(row) {
this.loadingTwo = true;
let data = await this.$api.huodongtuijian.activity(row.id);
if(data.code == 200){
if (data.code == 200) {
this.loadingTwo = false;
let {name,content,publisher,activityTime,address,ageRange,sexRange,politicalRange,educationRange,housingRange,industryRange,interestRange,professionalRange,schoolRange} = data.data;
let arr = [];
arr.push(ageRange,sexRange,politicalRange,educationRange,housingRange,industryRange,interestRange,professionalRange,schoolRange)
let arrtwo = []
arr.forEach((item)=>{
let obj = {}
if(item) {
obj['name'] = item
arrtwo.push(obj)
}
})
console.log(arrtwo)
this.dialogContent = {name,content,publisher,activityTime,address,label:arrtwo};
let arr = this.labelgenerate(data.data);
this.dialogContent = {
name: data.data.name,
content: data.data.content,
publisher: data.data.publisher,
activityTime: data.data.activityTime,
address: data.data.address,
label: arr,
};
console.log(this.dialogContent);
this.$refs.chakan.open();
}
},
//
participation(row){
participation(row) {
// this.$refs.participation.open();
this.$confirm('是否确定报名活动?', '确认信息', {
this.$confirm("是否确定报名活动?", "确认信息", {
distinguishCancelAndClose: true,
confirmButtonText: '确定',
cancelButtonText: '取消'
})
.then(() => {
this.action(row)
confirmButtonText: "确定",
cancelButtonText: "取消",
})
.catch(action => {
console.log(action)
});
.then(() => {
this.action(row);
})
.catch((action) => {
console.log(action);
});
},
//
async action(row){
async action(row) {
let downloadLoadingInstance = Loading.service({
text: "正在申请报名活动,请稍后",
spinner: "el-icon-loading",
background: "rgba(0, 0, 0, 0.7)",
});
let obj = {
activityId: row.id
}
let data = await this.$api.huodongtuijian.zyzreport(obj)
activityId: row.id,
};
let data = await this.$api.huodongtuijian.zyzreport(obj);
// alert('submit!');
if(data.code == 200) {
if (data.code == 200) {
downloadLoadingInstance.close();
this.$message({
message: "申请报名成功",
@ -272,14 +287,14 @@ export default {
}
},
//
close(){
close() {
this.$refs.participation.Close();
}
},
},
mounted(){
mounted() {
this.getList();
}
}
},
};
</script>
<style lang="scss" scoped>
.tables {
@ -293,14 +308,14 @@ export default {
line-height: 20px;
&:nth-child(1) {
font-size: 14px;
font-family: 'Alibaba PuHuiTi';
font-family: "Alibaba PuHuiTi";
font-weight: 400;
color: #4D4949;
color: #4d4949;
}
&:nth-child(2) {
width: 180px;
font-size: 14px;
font-family: 'Alibaba PuHuiTi';
font-family: "Alibaba PuHuiTi";
font-weight: 400;
color: #999191;
white-space: nowrap;
@ -314,18 +329,18 @@ export default {
box-sizing: border-box;
// text-align: center;
font-size: 14px;
font-family: 'Alibaba PuHuiTi';
font-family: "Alibaba PuHuiTi";
font-weight: 400;
color: #525966;
padding: 2px 0;
}
th {
height: 45px;
background-color: #F7F5F5;
background-color: #f7f5f5;
font-size: 15px;
font-family: 'Alibaba PuHuiTi';
font-family: "Alibaba PuHuiTi";
font-weight: bold;
color: #4D4949;
color: #4d4949;
.el-checkbox {
display: none;
}
@ -338,7 +353,7 @@ export default {
display: flex;
align-items: center;
// justify-content: center;
.look{
.look {
display: flex;
// align-items: center;
margin-right: 30px;
@ -351,7 +366,7 @@ export default {
font-size: 15px;
font-family: Alibaba PuHuiTi;
font-weight: 400;
color: #045FFD;
color: #045ffd;
}
}
}

@ -24,11 +24,18 @@
<div class="leftName">
<div>周爱</div>
<div class="mainTag">
<div>{{ item.ageRange }}</div>
<!-- <div>{{ item.ageRange }}</div>
<div>
{{ item.sexRange }}
</div>
<div>{{ item.educationRange }}</div>
<div>{{ item.educationRange }}</div> -->
<div
v-show="itema != ''"
v-for="(itema, index) in item.arrlist"
:key="index"
>
{{ itema }}
</div>
</div>
</div>
</div>
@ -37,7 +44,7 @@
</div>
</div>
</div>
<div v-else class="noneStyle" >暂无数据</div>
<div v-else class="noneStyle">暂无数据</div>
</div>
<div class="pagination" ref="pagination">
@ -139,6 +146,18 @@ export default {
value: "",
},
],
arr: [
"ageRange",
"sexRange",
"politicalRange",
"educationRange",
"housingRange",
"industryRange",
"interestRange",
"professionalRange",
"schoolRange",
"nationalityRange",
],
};
},
created() {
@ -164,10 +183,28 @@ export default {
this.form = { ...this.form, ...this.afterParams };
this.getList();
},
//
labelgenerate(data = {}) {
let arrlist = [];
for (let key3 of this.arr) {
for (let key4 in data) {
if (key3 == key4) {
let a = data[key3];
arrlist.push(a);
}
}
}
return arrlist;
},
getList() {
this.loads = true;
peopleList(this.form).then((res) => {
this.arrList = res.rows;
if (this.arrList.length > 0) {
this.arrList.forEach((item) => {
item.arrlist = this.labelgenerate(item);
});
}
this.total = res.total;
this.loads = false;
});
@ -187,16 +224,16 @@ export default {
</script>
<style lang="scss" scoped>
.noneStyle {
height: 490px;
margin-bottom: 12px;
display: flex;
align-items: center;
justify-content: center;
font-family: "Alibaba-PuHuiTi-Medium.otf";
color: #606266;
font-size: 14px;
}
.noneStyle {
height: 490px;
margin-bottom: 12px;
display: flex;
align-items: center;
justify-content: center;
font-family: "Alibaba-PuHuiTi-Medium.otf";
color: #606266;
font-size: 14px;
}
.center-content {
padding: 20px 30px;
}
@ -258,8 +295,10 @@ export default {
}
.mainTag {
display: flex;
flex-wrap: wrap;
font-family: "Alibaba-PuHuiTi-Regular";
& > div {
margin-bottom: 5px;
margin-right: 5px;
background-color: rgba(248, 65, 77, 0.06);
padding: 3px 5px;
@ -278,7 +317,7 @@ export default {
.subMan {
width: 49.2%;
height: 16.4%;
height: 20.4%;
background: #fafafa;
border: 1px solid #f5edeb;
border-radius: 10px;
@ -293,8 +332,8 @@ export default {
display: flex;
align-items: center;
.leftAvatar {
height: 55px;
width: 55px;
min-height: 100%;
width: 77px;
background-size: 100% 100%;
border-radius: 10px;
}
@ -304,8 +343,11 @@ export default {
font-family: "Alibaba-PuHuiTi-Medium.otf";
color: #4c4949;
font-size: 18px;
margin-bottom: 12px;
margin-bottom: 5px;
}
& > div:nth-of-type(2) {
margin-bottom: -10px;
}
}
}
.rightSub {

@ -31,17 +31,13 @@
</div>
<div class="itemE">
<div>活动标签:</div>
<div class="mainTag">
<div v-if="detailData.ageRange != ''">
{{ detailData.ageRange }}
</div>
<div>
{{
detailData.sexRange == "" ? "男女不限" : detailData.sexRange
}}
</div>
<div v-if="detailData.educationRange != ''">
{{ detailData.educationRange }}
<div class="mainTag mainTag-label">
<div
v-for="(item, index) in detailDatalist"
:key="index"
v-show="item != ''"
>
{{ item }}
</div>
</div>
</div>
@ -75,12 +71,12 @@
<div class="leftName">
<div>{{ item.id }}</div>
<div class="mainTag">
<div v-if="item.ageRange != ''">{{ item.ageRange }}</div>
<div v-if="item.sexRange != ''">
{{ item.sexRange }}
</div>
<div v-if="item.educationRange != ''">
{{ item.educationRange }}
<div
v-show="item != ''"
v-for="(item, index) in item.arrlist"
:key="index"
>
{{ item }}
</div>
</div>
</div>
@ -130,10 +126,12 @@
<div class="leftName">
<div>周爱</div>
<div class="mainTag">
<div v-if="item.ageRange != ''">{{ item.ageRange }}</div>
<div v-if="item.sexRange != ''">{{ item.sexRange }}</div>
<div v-if="item.educationRange != ''">
{{ item.educationRange }}
<div
v-show="item != ''"
v-for="(item, index) in item.arrlist"
:key="index"
>
{{ item }}
</div>
</div>
</div>
@ -253,6 +251,7 @@ export default {
],
dialogVisible: false,
detailData: {},
detailDatalist: [],
load1: true,
personList: [],
personTotal: 0,
@ -279,6 +278,18 @@ export default {
activityId: "",
},
peopelDetail: false,
arr: [
"ageRange",
"sexRange",
"politicalRange",
"educationRange",
"housingRange",
"industryRange",
"interestRange",
"professionalRange",
"schoolRange",
"nationalityRange",
],
};
},
props: {},
@ -294,6 +305,7 @@ export default {
}
}
}
this.detailDatalist = this.labelgenerate(this.detailData);
if (this.personParams.sexRange == "") {
this.personParams.sexRange = "男,女";
}
@ -303,9 +315,23 @@ export default {
this.dialogVisible = true;
});
},
//
labelgenerate(data = {}) {
let arrlist = [];
for (let key3 of this.arr) {
for (let key4 in data) {
if (key3 == key4) {
let a = data[key3];
arrlist.push(a);
}
}
}
return arrlist;
},
//
closeDetail() {
this.detailData = {};
this.detailDatalist = [];
this.dialogVisible = false;
},
getPersonData() {
@ -313,6 +339,12 @@ export default {
this.load1 = true;
peopleList(this.personParams).then((res) => {
this.personList = res.rows;
if (this.personList.length > 0) {
this.personList.forEach((item) => {
item.arrlist = this.labelgenerate(item);
});
}
this.personTotal = res.total;
this.load1 = false;
});
@ -322,6 +354,11 @@ export default {
//
canyuList(this.participationParams).then((res) => {
this.participationList = res.rows;
if (this.participationList.length > 0) {
this.participationList.forEach((item) => {
item.arrlist = this.labelgenerate(item);
});
}
this.participationTotal = res.total;
this.load2 = false;
});
@ -393,10 +430,17 @@ export default {
::v-deep .titlePagin .el-pagination {
padding: 0;
}
.mainTag-label {
position: absolute;
width: 300px;
right: -30px;
}
.mainTag {
display: flex;
flex-wrap: wrap;
font-family: "Alibaba-PuHuiTi-Regular";
& > div {
margin-bottom: 5px;
margin-right: 5px;
background-color: rgba(248, 65, 77, 0.06);
padding: 3px 5px;
@ -474,6 +518,7 @@ export default {
margin-bottom: 12px;
.itemE {
position: relative;
width: 50%;
display: flex;
& > div:nth-of-type(1) {
@ -496,8 +541,11 @@ export default {
width: 12%;
}
& > div:nth-of-type(2) {
width: 88%;
width: 50%;
color: #606266;
white-space: nowrap; /* 不换行 */
overflow: hidden; /* 超出部分隐藏 */
text-overflow: ellipsis; /* 溢出显示省略号 */
}
}
.noneStyle {
@ -512,12 +560,12 @@ export default {
}
.mainPeople {
overflow: auto;
height: 200px;
// height: 200px;
box-sizing: border-box;
margin-bottom: 12px;
.subMan {
width: 100%;
height: 95px;
min-height: 95px;
background: #fafafa;
border: 1px solid #f5edeb;
border-radius: 10px;
@ -532,18 +580,23 @@ export default {
display: flex;
align-items: center;
.leftAvatar {
height: 65px;
width: 65px;
width: 20%;
min-height: 95px;
background-size: 100% 100%;
border-radius: 10px;
}
.leftName {
width: 80%;
margin-left: 15px;
& > div:nth-of-type(1) {
font-family: "Alibaba-PuHuiTi-Medium.otf";
color: #4c4949;
font-size: 18px;
margin-bottom: 18px;
margin-bottom: 10px;
}
& > div:nth-of-type(2) {
margin-bottom: -15px;
}
}
}
@ -603,4 +656,4 @@ export default {
::-webkit-scrollbar-track {
background: #f4f1f1;
}
</style>
</style>

@ -0,0 +1,402 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="字典名称" prop="dictType">
<el-select v-model="queryParams.dictType">
<el-option
v-for="item in typeOptions"
:key="item.dictId"
:label="item.dictName"
:value="item.dictType"
/>
</el-select>
</el-form-item>
<el-form-item label="字典标签" prop="dictLabel">
<el-input
v-model="queryParams.dictLabel"
placeholder="请输入字典标签"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="数据状态" clearable>
<el-option
v-for="dict in dict.type.sys_normal_disable"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<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-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<!-- <el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:dict:add']"
>新增</el-button>
</el-col> -->
<!-- <el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:dict:edit']"
>修改</el-button>
</el-col> -->
<!-- <el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:dict:remove']"
>删除</el-button>
</el-col> -->
<!-- <el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:dict:export']"
>导出</el-button>
</el-col> -->
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-close"
size="mini"
@click="handleClose"
>关闭</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="字典编码" align="center" prop="dictCode" />
<el-table-column label="字典标签" align="center" prop="dictLabel">
<template slot-scope="scope">
<span v-if="(scope.row.listClass == '' || scope.row.listClass == 'default') && (scope.row.cssClass == '' || scope.row.cssClass == null)">{{ scope.row.dictLabel }}</span>
<el-tag v-else :type="scope.row.listClass == 'primary' ? '' : scope.row.listClass" :class="scope.row.cssClass">{{ scope.row.dictLabel }}</el-tag>
</template>
</el-table-column>
<el-table-column label="字典键值" align="center" prop="dictValue" />
<el-table-column label="字典排序" align="center" prop="dictSort" />
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:dict:edit']"
>修改</el-button>
<!-- <el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:dict:remove']"
>删除</el-button> -->
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改参数配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="字典类型">
<el-input v-model="form.dictType" :disabled="true" />
</el-form-item>
<el-form-item label="数据标签" prop="dictLabel">
<el-input v-model="form.dictLabel" placeholder="请输入数据标签" />
</el-form-item>
<el-form-item label="数据键值" prop="dictValue">
<el-input v-model="form.dictValue" placeholder="请输入数据键值" />
</el-form-item>
<el-form-item label="样式属性" prop="cssClass">
<el-input v-model="form.cssClass" placeholder="请输入样式属性" />
</el-form-item>
<el-form-item label="显示排序" prop="dictSort">
<el-input-number v-model="form.dictSort" controls-position="right" :min="0" />
</el-form-item>
<el-form-item label="回显样式" prop="listClass">
<el-select v-model="form.listClass">
<el-option
v-for="item in listClassOptions"
:key="item.value"
:label="item.label + '(' + item.value + ')'"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-radio-group v-model="form.status">
<el-radio
v-for="dict in dict.type.sys_normal_disable"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listData, getData, delData, addData, updateData } from "@/api/system/dict/data";
import { optionselect as getDictOptionselect, getType } from "@/api/system/dict/type";
export default {
name: "Data",
dicts: ['sys_normal_disable'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
dataList: [],
//
defaultDictType: "",
//
title: "",
//
open: false,
//
listClassOptions: [
{
value: "default",
label: "默认"
},
{
value: "primary",
label: "主要"
},
{
value: "success",
label: "成功"
},
{
value: "info",
label: "信息"
},
{
value: "warning",
label: "警告"
},
{
value: "danger",
label: "危险"
}
],
//
typeOptions: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
dictName: undefined,
dictType: undefined,
status: undefined
},
//
form: {},
//
rules: {
dictLabel: [
{ required: true, message: "数据标签不能为空", trigger: "blur" }
],
dictValue: [
{ required: true, message: "数据键值不能为空", trigger: "blur" }
],
dictSort: [
{ required: true, message: "数据顺序不能为空", trigger: "blur" }
]
}
};
},
created() {
const dictId = this.$route.params && this.$route.params.dictId;
this.getType(dictId);
this.getTypeList();
},
methods: {
/** 查询字典类型详细 */
getType(dictId) {
getType(dictId).then(response => {
this.queryParams.dictType = response.data.dictType;
this.defaultDictType = response.data.dictType;
this.getList();
});
},
/** 查询字典类型列表 */
getTypeList() {
getDictOptionselect().then(response => {
this.typeOptions = response.data;
});
},
/** 查询字典数据列表 */
getList() {
this.loading = true;
listData(this.queryParams).then(response => {
this.dataList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
dictCode: undefined,
dictLabel: undefined,
dictValue: undefined,
cssClass: undefined,
listClass: 'default',
dictSort: 0,
status: "0",
remark: undefined
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 返回按钮操作 */
handleClose() {
const obj = { path: "/volunteer/zyzsjgl/zdgl" };
this.$tab.closeOpenPage(obj);
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.queryParams.dictType = this.defaultDictType;
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加字典数据";
this.form.dictType = this.queryParams.dictType;
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.dictCode)
this.single = selection.length!=1
this.multiple = !selection.length
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const dictCode = row.dictCode || this.ids
getData(dictCode).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改字典数据";
});
},
/** 提交按钮 */
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.dictCode != undefined) {
updateData(this.form).then(response => {
this.$store.dispatch('dict/removeDict', this.queryParams.dictType);
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addData(this.form).then(response => {
this.$store.dispatch('dict/removeDict', this.queryParams.dictType);
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const dictCodes = row.dictCode || this.ids;
this.$modal.confirm('是否确认删除字典编码为"' + dictCodes + '"的数据项?').then(function() {
return delData(dictCodes);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
this.$store.dispatch('dict/removeDict', this.queryParams.dictType);
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/dict/data/export', {
...this.queryParams
}, `data_${new Date().getTime()}.xlsx`)
}
}
};
</script>

@ -52,7 +52,7 @@
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<!-- <el-col :span="1.5">
<el-button
type="primary"
plain
@ -61,8 +61,8 @@
@click="handleAdd"
v-hasPermi="['system:dict:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
</el-col> -->
<!-- <el-col :span="1.5">
<el-button
type="success"
plain
@ -93,7 +93,7 @@
@click="handleExport"
v-hasPermi="['system:dict:export']"
>导出</el-button>
</el-col>
</el-col> -->
<el-col :span="1.5">
<el-button
type="danger"
@ -113,7 +113,7 @@
<el-table-column label="字典名称" align="center" prop="dictName" :show-overflow-tooltip="true" />
<el-table-column label="字典类型" align="center" :show-overflow-tooltip="true">
<template slot-scope="scope">
<router-link :to="'/system/dict-data/index/' + scope.row.dictId" class="link-type">
<router-link :to="'/volunteer/zyzsjgl/zdgl/' + scope.row.dictId" class="link-type">
<span>{{ scope.row.dictType }}</span>
</router-link>
</template>
@ -138,13 +138,13 @@
@click="handleUpdate(scope.row)"
v-hasPermi="['system:dict:edit']"
>修改</el-button>
<el-button
<!-- <el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:dict:remove']"
>删除</el-button>
>删除</el-button> -->
</template>
</el-table-column>
</el-table>
@ -189,10 +189,11 @@
<script>
import { listType, getType, delType, addType, updateType, refreshCache } from "@/api/system/dict/type";
import delgdata from "./data.vue"
export default {
name: "Dict",
dicts: ['sys_normal_disable'],
components:{delgdata},
data() {
return {
//

Loading…
Cancel
Save