master
xy 2 years ago
parent 8170af3d31
commit 974e30f17d

@ -15,6 +15,7 @@ import {
const getDefaultState = () => {
return {
token: getToken(),
id: "",
name: '',
avatar: '',
roles: [],
@ -42,6 +43,9 @@ const mutations = {
},
SET_DEPARTMENT:(state, department) => {
state.department = department
},
SET_ID:(state, id) => {
state.id = id
}
}
@ -86,6 +90,7 @@ const actions = {
}
response["roles"] = ["admin"];
const {
id,
roles,
name,
avatar,
@ -98,6 +103,7 @@ const actions = {
commit('SET_NAME', name)
commit('SET_AVATAR', avatar)
commit('SET_DEPARTMENT', department)
commit('SET_ID', id)
resolve(response)
}).catch(error => {
reject(error)

@ -52,6 +52,11 @@ export default {
page_size: 20,
table_name: "tags",
filter: [
{
key: 'zhuangtai',
op: 'eq',
value: '1'
},
{
key: "mingcheng",
op: "like",

@ -12,7 +12,7 @@
<slot>
<header-content :auths="auths_auth_mixin">
<template #search>
<div style="display: flex">
<div style="display: flex;align-items: center;">
<Select
v-model="select.filter[1].key"
style="width: 100px"
@ -104,6 +104,7 @@
@input="(e) => inputEndHandler(e, select.filter[1])"
/>
</template>
<el-switch v-model="value1" active-text="查询自己" inactive-text="查询所有" style="margin-left: 10px;" @change="switchChange"></el-switch>
<Button
style="margin-left: 10px"
type="primary"
@ -286,15 +287,53 @@
}
"
>
<template #edit="{ row }" v-if="/^\/manage/.test($route.path)">
<Button v-if="row.zhuangtai == 0 || row.zhuangtai == 3" type="primary" style="margin-right: 6px;" size="small" @click="() => {
$refs['dialog'].setId(row.id);
$refs['dialog'].setType('editor');
$refs['dialog'].show();
}"
>编辑</Button
>
</template>
<template #delete="scope" v-if="/^\/manage/.test($route.path)">
<el-popover width="180" trigger="hover" v-if="scope.row.zhuangtai == 0 || scope.row.zhuangtai == 3">
<template #default>
<div>
<p :style="{ 'padding-bottom': '10px' }">确定要删除吗</p>
<div :style="{ 'text-align': 'right', margin: '0' }">
<el-button size="mini" type="text">取消</el-button>
<el-button
type="primary"
size="mini"
@click="
() => {
destroy({ id: scope.row.id, table_name: 'materials' }).then(res => $refs['xyTable'].getTableData())
}
"
>确定</el-button
>
</div>
</div>
</template>
<template #reference>
<div
:style="{ 'margin-right': '6px', height: '100%', width: '100%' }"
>
<Button type="error" size="small">删除</Button>
</div>
</template>
</el-popover>
</template>
<template #submit="scope">
<template v-if="scope.row.zhuangtai == 0">
<template v-if="scope.row.zhuangtai == 0 || scope.row.zhuangtai == 3">
<Button type="primary" size="small" @click="submit(scope, 1)"
>提交</Button
>
</template>
<template v-else>
<Button type="error" ghost size="small" @click="submit(scope, 0)"
>下架</Button
>取消提交</Button
>
</template>
</template>
@ -392,6 +431,7 @@ export default {
},
data() {
return {
value1: false,
op,
select: {
table_name: "",
@ -434,6 +474,19 @@ export default {
};
},
switchChange (e) {
if (e) {
this.select.filter.push({
key: 'admin_id',
op: 'eq',
value: this.$store.state.user.id
})
} else {
this.select.filter.splice(this.select.filter.indexOf(this.select.filter.find(i => i.key === 'admin_id')),1)
}
console.log(this.select.filter)
},
async exportExcel(sheetName) {
const res = await index(
Object.assign(this.select, { page: 1, page_size: 9999 })
@ -518,7 +571,7 @@ export default {
async () => {
const res = await listdeptNoAuth({
page: 1,
page_size: 999
page_size: 999,
});
return res;
},
@ -662,31 +715,30 @@ export default {
};
}
}
if (!/\/manage\/rule/.test(this.$route.fullPath) &&
!!["nianfen", "bianhao", "wenjian"].find(
(j) => j === i.field
)) {
if (
!/\/manage\/rule/.test(this.$route.fullPath) &&
!!["nianfen", "bianhao", "wenjian"].find((j) => j === i.field)
) {
} else {
this.table.push(Object.assign(
{
prop: i.field,
label: i.name,
width: i.width,
fixed: i.is_fixed,
},
linkOb
))
this.table.push(
Object.assign(
{
prop: i.field,
label: i.name,
width: i.width,
fixed: i.is_fixed,
},
linkOb
)
);
}
});
this.table.unshift({
type: "index",
width: 60,
label: "序号",
});
},
},

@ -285,6 +285,11 @@ export default {
vm.getMaterial();
});
},
destroyed() {
this.$store.commit("reception/SET_SELECTED",{
refresh: true
})
}
};
</script>

@ -23,10 +23,7 @@
</el-table-column>
<el-table-column prop="username" label="用户名">
</el-table-column>
<el-table-column prop="department" label="部门">
<template slot-scope="scope">
{{scope.row.department.name}}
</template>
<el-table-column prop="department.name" label="部门">
</el-table-column>
<el-table-column prop="address" label="角色">
<template slot-scope="scope">

Loading…
Cancel
Save