更新组织、用户管理对接接口

This commit is contained in:
du 2024-01-26 15:52:29 +08:00
parent f147d124e8
commit 0458034b1c
7 changed files with 565 additions and 522 deletions

View File

@ -12,7 +12,9 @@ VITE_OPEN_PROXY = false
VITE_PROXY_API = /dev-api VITE_PROXY_API = /dev-api
# VITE_PROXY = [ ["/dev-api", "http://192.168.110.186:8040" ],["/dev-img-api", "http://file.sczysoft.com" ]] # VITE_PROXY = [ ["/dev-api", "http://192.168.110.186:8040" ],["/dev-img-api", "http://file.sczysoft.com" ]]
VITE_PROXY = [ ["/dev-api", "http://42.193.40.239:8010" ],["/dev-img-api", "http://file.sczysoft.com" ]]
# http://42.193.40.239:8017/doc.html//线上 http://192.168.110.186:8017/doc.html//本地
VITE_PROXY = [ ["/dev-api", "http://192.168.110.186:8017" ],["/dev-img-api", "http://file.sczysoft.com" ]]
# #
VITE_GLOB_UPLOAD_URL=/dev-api VITE_GLOB_UPLOAD_URL=/dev-api
VITE_UPLOAD_IMG_URL=/dev-img-api VITE_UPLOAD_IMG_URL=/dev-img-api

View File

@ -12,17 +12,6 @@ export function getUserPage(data) {
}); });
} }
/**
*
*/
export function delUser(userId) {
return request({
url: `${prefix}/delUser`,
method: "POST",
data: { userId }
});
}
/** /**
* *
*/ */
@ -238,11 +227,10 @@ export function delBaseinclass(data) {
/** /**
* *
*/ */
export function getListperformTree(params) { export function getListperformTree() {
return request({ return request({
url: `/admin/Sys/getListperformTree`, url: `/admin/Sys/getListperformTree`,
method: "GET", method: "GET",
params
}); });
} }
@ -277,3 +265,44 @@ export function performDel(listperformid) {
method: "POST" method: "POST"
}); });
} }
/**
* -List
*/
export function getSysroleList() {
return request({
url: `/admin/Sys/getSysroleList`,
method: "GET"
});
}
/**
* -
*/
export function saveUser(data) {
return request({
url: `/admin/Sys/saveUser`,
method: "POST",
data:data
});
}
/**
*-
*/
export function delUser(params) {
return request({
url: `/admin/Sys/delUser`,
method: "POST",
data: params
});
}
/**
*-
*/
export function delListperform(listperformid) {
return request({
url: `/admin/Sys/delListperform/${listperformid}`,
method: "POST",
});
}

View File

@ -1,38 +1,32 @@
/** el-progress-bar */ /** el-progress-bar */
.el-progress-bar__inner { .el-progress-bar__inner {
background-image: linear-gradient(270deg, rgb(65, 251, 217) 0%, rgb(3, 142, 254) 100%); background-image: linear-gradient(270deg, rgb(65 251 217) 0%, rgb(3 142 254) 100%);
} }
/** el-dialog custom-dialog */ /** el-dialog custom-dialog */
.custom-dialog { .custom-dialog {
border-radius: 10px; border-radius: 10px;
.el-dialog__header { .el-dialog__header {
padding: 16px; padding: 16px;
position: relative; position: relative;
.custom-dialog-title { .custom-dialog-title {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
padding-bottom: 6px; padding-bottom: 6px;
span { span {
color: #333333; color: #333;
font-weight: bold; font-weight: bold;
} }
.icon-style { .icon-style {
width: 0.875em; width: 0.875em;
height: 0.875em; height: 0.875em;
fill: #B5C4E1; fill: #b5c4e1;
&:hover { &:hover {
opacity: 0.9; opacity: 0.9;
} }
} }
hr { hr {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
@ -42,21 +36,17 @@
border: 1px solid #f5f5f5 !important; border: 1px solid #f5f5f5 !important;
} }
} }
.el-dialog__headerbtn { .el-dialog__headerbtn {
display: none; display: none;
} }
} }
.el-dialog__body { .el-dialog__body {
padding: 16px; padding: 16px;
padding-top: 6px; padding-top: 6px;
} }
.el-dialog__footer { .el-dialog__footer {
padding-top: 0; padding-top: 0;
text-align: center; text-align: center;
.el-button { .el-button {
margin: 0 16px; margin: 0 16px;
} }
@ -69,7 +59,6 @@
padding: 16px; padding: 16px;
position: relative; position: relative;
margin-bottom: 0; margin-bottom: 0;
.custom-drawer-title { .custom-drawer-title {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
@ -77,7 +66,6 @@
justify-content: space-between; justify-content: space-between;
padding-bottom: 6px; padding-bottom: 6px;
} }
.custom-drawer-title hr { .custom-drawer-title hr {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
@ -86,22 +74,18 @@
left: 50%; left: 50%;
border: 1px solid #cecece; border: 1px solid #cecece;
} }
.custom-drawer-title .icon-style { .custom-drawer-title .icon-style {
width: 0.875em; width: 0.875em;
height: 0.875em; height: 0.875em;
fill: #B5C4E1; fill: #b5c4e1;
&:hover { &:hover {
opacity: 0.9; opacity: 0.9;
} }
} }
.el-drawer__close-btn { .el-drawer__close-btn {
display: none; display: none;
} }
} }
.el-drawer__body { .el-drawer__body {
// padding: 16px; // padding: 16px;
height: 100%; height: 100%;
@ -114,21 +98,17 @@
display: flow-root; display: flow-root;
width: 100%; width: 100%;
margin: 0 auto; margin: 0 auto;
.el-form-item { .el-form-item {
width: 44%; width: 44%;
float: left; float: left;
margin: 0 3%; margin: 0 3%;
margin-bottom: 22px; margin-bottom: 22px;
} }
.inline-block { .inline-block {
width: 94%; width: 94%;
} }
} }
.el-form-item { .el-form-item {
.el-select, .el-select,
.el-cascader, .el-cascader,
.el-input-number, .el-input-number,
@ -143,27 +123,21 @@
border: 1px solid #5473e8; border: 1px solid #5473e8;
} }
} }
.search .el-input__inner { .search .el-input__inner {
border: 1px solid #5473e8; border: 1px solid #5473e8;
} }
.el-input-group__append { .el-input-group__append {
background-color: #5473e8 !important; background-color: #5473e8 !important;
border-color: #5473e8 !important; border-color: #5473e8 !important;
box-shadow: none;
cursor: pointer; cursor: pointer;
padding: 0 16px; padding: 0 16px;
box-shadow: none; box-shadow: none;
&:hover { &:hover {
opacity: 0.8; opacity: 0.8;
} }
&:active { &:active {
border-color: #7bb6fa; border-color: #7bb6fa;
} }
.search-bottom { .search-bottom {
color: #fff; color: #fff;
display: flex; display: flex;
@ -171,7 +145,6 @@
font-size: 14px; font-size: 14px;
flex-direction: row; flex-direction: row;
} }
svg { svg {
padding-right: 6px; padding-right: 6px;
} }
@ -181,11 +154,9 @@
.el-row { .el-row {
margin-bottom: 22px; margin-bottom: 22px;
} }
.operation { .operation {
margin-bottom: 0px; margin-bottom: 0;
} }
.keyword { .keyword {
margin-top: 24px; margin-top: 24px;
} }
@ -195,7 +166,6 @@
display: flex; display: flex;
align-items: center; align-items: center;
height: 30px; height: 30px;
label { label {
background: #f9f9f9; background: #f9f9f9;
border: 1px solid #e6e6e6; border: 1px solid #e6e6e6;
@ -208,25 +178,20 @@
display: flex; display: flex;
align-items: center; align-items: center;
} }
.el-input__inner { .el-input__inner {
border-top-left-radius: 0; border-top-left-radius: 0;
border-bottom-left-radius: 0; border-bottom-left-radius: 0;
height: 100% !important; height: 100% !important;
} }
.el-cascader { .el-cascader {
height: 100%; height: 100%;
} }
.el-select { .el-select {
height: 100%; height: 100%;
} }
.select-trigger { .select-trigger {
height: 100%; height: 100%;
} }
.el-input { .el-input {
height: 100%; height: 100%;
} }
@ -234,63 +199,54 @@
/** el-table */ /** el-table */
.el-table { .el-table {
th, th,
td { td {
padding: 8px 0; padding: 8px 0;
} }
.el-one-header { .el-one-header {
th { th {
text-align: center; text-align: center;
background-color: #F2F2F2; background-color: #f2f2f2;
} }
} }
.el-one-header1 { .el-one-header1 {
th { th {
text-align: left; text-align: left;
background-color: #F2F2F2; background-color: #f2f2f2;
} }
} }
.operate { .operate {
margin: 0 16px; margin: 0 16px;
cursor: pointer; cursor: pointer;
&:hover { &:hover {
opacity: 0.8; opacity: 0.8;
} }
svg { svg {
margin-right: 3px; margin-right: 3px;
vertical-align: -0.12em; vertical-align: -0.12em;
width: 1em; width: 1em;
height: 1em; height: 1em;
} }
.edit { .edit {
color: #1d86fb; color: #1d86fb;
} }
.detail { .detail {
color: #f4a914; color: #f4a914;
} }
.func { .func {
color: #fb4e33; color: #fb4e33;
} }
.delete {
color: #fb4e33;
}
.statute { .statute {
color: #226cb6; color: #226cb6;
} }
} }
} }
.look { .look {
color: #1d86fb; color: #1d86fb;
cursor: pointer; cursor: pointer;
&:hover { &:hover {
opacity: 0.8; opacity: 0.8;
} }
@ -304,11 +260,9 @@
position: relative; position: relative;
overflow: hidden; overflow: hidden;
} }
.avatar-uploader .el-upload:hover { .avatar-uploader .el-upload:hover {
border-color: #409eff; border-color: #409eff;
} }
.avatar-uploader-icon { .avatar-uploader-icon {
font-size: 28px; font-size: 28px;
color: #8c939d; color: #8c939d;
@ -317,7 +271,6 @@
line-height: 100px; line-height: 100px;
text-align: center; text-align: center;
} }
.avatar { .avatar {
width: 100px; width: 100px;
height: 100px; height: 100px;
@ -329,39 +282,32 @@
.el-tabs__nav-prev { .el-tabs__nav-prev {
font-size: 18px; font-size: 18px;
} }
.el-table .el-table__body-wrapper::-webkit-scrollbar { .el-table .el-table__body-wrapper::-webkit-scrollbar {
background-color: #f2f2f2; background-color: #f2f2f2;
} }
.el-table .el-table__body-wrapper::-webkit-scrollbar-thumb { .el-table .el-table__body-wrapper::-webkit-scrollbar-thumb {
background-color: #c9c9c9; background-color: #c9c9c9;
cursor: pointer; cursor: pointer;
} }
.custom-dialog-title { .custom-dialog-title {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
padding-bottom: 6px; padding-bottom: 6px;
span { span {
color: #333333; color: #333;
font-weight: bold; font-weight: bold;
font-size: 16px; font-size: 16px;
} }
.icon-style { .icon-style {
width: 0.875em; width: 0.875em;
height: 0.875em; height: 0.875em;
fill: #B5C4E1; fill: #b5c4e1;
&:hover { &:hover {
opacity: 0.9; opacity: 0.9;
} }
} }
hr { hr {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
@ -371,17 +317,14 @@
border: 1px solid #f5f5f5 !important; border: 1px solid #f5f5f5 !important;
} }
} }
.el-popper { .el-popper {
max-width: 50vw; max-width: 50vw;
} }
.tree-line { .tree-line {
.el-tree-node { .el-tree-node {
position: relative; position: relative;
padding-left: 12px; // 缩进量 padding-left: 12px; // 缩进量
} }
.el-tree-node__children { .el-tree-node__children {
padding-left: 12px; // 缩进量 padding-left: 12px; // 缩进量
} }
@ -392,7 +335,7 @@
height: 100%; height: 100%;
width: 1px; width: 1px;
position: absolute; position: absolute;
left: 0px; left: 0;
top: -20px; top: -20px;
border-width: 1px; border-width: 1px;
border-left: 1px dashed #52627c; border-left: 1px dashed #52627c;
@ -409,16 +352,14 @@
width: 12px; width: 12px;
height: 20px; height: 20px;
position: absolute; position: absolute;
left: 0px; left: 0;
top: 20px; top: 20px;
border-width: 1px; border-width: 1px;
border-top: 1px dashed #52627c; border-top: 1px dashed #52627c;
} }
& > .el-tree-node::after { & > .el-tree-node::after {
border-top: none; border-top: none;
} }
& > .el-tree-node::before { & > .el-tree-node::before {
border-left: none; border-left: none;
} }
@ -426,7 +367,6 @@
// 展开关闭的icon // 展开关闭的icon
.el-tree-node__expand-icon { .el-tree-node__expand-icon {
font-size: 16px; font-size: 16px;
&.is-leaf { &.is-leaf {
color: transparent; color: transparent;
} }

View File

@ -24,10 +24,10 @@
v-model="addPostFactorForm.sysusername" v-model="addPostFactorForm.sysusername"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="密码:" prop="pwd"> <el-form-item label="密码:" prop="password">
<el-input <el-input
placeholder="请输入密码" placeholder="请输入密码"
v-model="addPostFactorForm.pwd" v-model="addPostFactorForm.password"
@focus="pwdFocus" @focus="pwdFocus"
></el-input> ></el-input>
</el-form-item> </el-form-item>
@ -54,16 +54,25 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="角色类型:" prop="memberType"> <el-form-item label="岗位:" prop="systitle">
<el-select v-model="addPostFactorForm.memberType"> <el-tree-select
<el-option v-model="addPostFactorForm.systitle"
v-for="(item, index) in roleTypeList" :data="postList"
:key="index" :props="postProps"
:label="item.label" :render-after-expand="false"
:value="item.value" style="width: 240px;"
></el-option> />
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="状态:" prop="delState">
<el-switch
v-model="addPostFactorForm.delState"
active-text="启用"
inactive-text="禁用"
:active-value="1"
:inactive-value="2"
/>
</el-form-item>
<!-- <el-form-item label="照片:"> <!-- <el-form-item label="照片:">
<el-upload <el-upload
class="avatar-uploader" class="avatar-uploader"
@ -92,6 +101,7 @@ import useUserStore from "@/store/modules/user";
import { ElMessage, FormInstance, FormRules } from "element-plus"; import { ElMessage, FormInstance, FormRules } from "element-plus";
import { getYears, getUUID, FileType } from "@/utils/common"; import { getYears, getUUID, FileType } from "@/utils/common";
import { saveOthexpert, getOtheWareHouseList } from "@/api/Othteam"; import { saveOthexpert, getOtheWareHouseList } from "@/api/Othteam";
import { getSysroleList, getListperformTree,saveUser } from "@/api/Sys";
const formRef = ref<FormInstance>(); const formRef = ref<FormInstance>();
const userStore = useUserStore(); const userStore = useUserStore();
@ -100,7 +110,7 @@ const userId = ref(user.value.userId);
const uuid = ref(""); const uuid = ref("");
const ruleForm = reactive<FormRules>({ const ruleForm = reactive<FormRules>({
sysusername: [{ required: true, message: "请输入账号", trigger: "blur" }], sysusername: [{ required: true, message: "请输入账号", trigger: "blur" }],
pwd: [{ required: true, message: "请输入密码", trigger: "blur" }], password: [{ required: true, message: "请输入密码", trigger: "blur" }],
chinaname: [{ required: true, message: "请输入中文名", trigger: "blur" }], chinaname: [{ required: true, message: "请输入中文名", trigger: "blur" }],
userroles: [{ required: true, message: "请选择角色", trigger: "change" }], userroles: [{ required: true, message: "请选择角色", trigger: "change" }],
sysunitorentid: [ sysunitorentid: [
@ -109,6 +119,8 @@ const ruleForm = reactive<FormRules>({
systitle: [{ required: true, message: "请选择岗位", trigger: "change" }], systitle: [{ required: true, message: "请选择岗位", trigger: "change" }],
state: [{ required: true, message: "请选择账号状态", trigger: "change" }], state: [{ required: true, message: "请选择账号状态", trigger: "change" }],
orgcodes: [{ required: true, message: "请选择任职地区", trigger: "change" }], orgcodes: [{ required: true, message: "请选择任职地区", trigger: "change" }],
delState: [{ required: true, message: "请选择状态", trigger: "change" }],
}); });
const props = defineProps({ const props = defineProps({
visible: { visible: {
@ -122,42 +134,70 @@ const props = defineProps({
}, },
id: String, id: String,
}); });
const listperformid = ref(props.id);
const addPostFactorForm = ref(<any>{}); const addPostFactorForm = ref(<any>{});
const emits = defineEmits(["close", "onSubmit"]); const emits = defineEmits(["close", "onSubmit"]);
//退 //退
const handleSubmit = () => { const handleSubmit = () => {
formRef.value?.validate((valid) => { formRef.value?.validate((valid) => {
if (valid) { if (valid) {
addPostFactorForm.value.othage = Number(addPostFactorForm.value.othage); addPostFactorForm.value.sysuserid = addPostFactorForm.value.sysuserid||uuid.value;
addPostFactorForm.value.othexpertid = saveUser(addPostFactorForm.value).then((res: any) => {
addPostFactorForm.value.othexpertid || uuid.value;
addPostFactorForm.value.userId = userId.value;
saveOthexpert(addPostFactorForm.value).then((res: any) => {
if (res.code == 1) { if (res.code == 1) {
ElMessage.success({ ElMessage.success({
message: "保存成功", message: "保存成功",
type: "success", type: "success",
}); });
onclone(); onclone();
}else{
ElMessage.error({
message: res.message,
type: "error",
});
} }
}); });
} }
return false; return false;
}); });
}; };
//List
const roleList = ref([]);
const getRoleList = () => {
getSysroleList().then((res: any) => {
if (res.code == 1) {
roleList.value = res.data;
}
});
};
//List
const postList = ref([]);
const postProps = {
value: "listperformid",
label: "parentName",
children: "children",
};
const ListperformTree = () => {
getListperformTree().then((res: any) => {
if (res.code == 1) {
postList.value = res.data;
}
});
};
// //
const onclone = () => { const onclone = () => {
emits("close"); emits("close");
}; };
onMounted(() => {}); onMounted(() => {
getRoleList();
ListperformTree();
});
watch( watch(
() => props.form, () => props.form,
(val) => { (val) => {
uuid.value = getUUID(); uuid.value = getUUID();
if (val) { if (props.form.sysuserid) {
if (!props.visible) return;
addPostFactorForm.value = val; addPostFactorForm.value = val;
}else{
addPostFactorForm.value.delState = 1
} }
} }
); );

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="percentage-content"> <div class="percentage-content">
<div class="content"> <div class="content">
<div style="margin-bottom: 16px" class="h-layout space-between h-center"> <div style="margin-bottom: 16px;" class="h-layout space-between h-center">
<div> <div>
<div class="h-layout"> <div class="h-layout">
<div class="tool-item" @click="getList"> <div class="tool-item" @click="getList">
@ -19,17 +19,17 @@
<svg-icon name="export" class="icon" /> <svg-icon name="export" class="icon" />
<span>导出</span> <span>导出</span>
</div> </div>
<div <!-- <div
v-if="tableCheckBoxs.length > 0" v-if="tableCheckBoxs.length > 0"
class="tool-item" class="tool-item"
@click="deletelist" @click="deletelist"
> >
<svg-icon name="delete" class="icon" /> <svg-icon name="delete" class="icon" />
<span>删除</span> <span>删除</span>
</div> -->
</div> </div>
</div> </div>
</div> <div style="width: 30%;">
<div style="width: 30%">
<div> <div>
<el-input <el-input
v-model="search" v-model="search"
@ -107,9 +107,11 @@
> >
<template #default="scope"> <template #default="scope">
<el-switch <el-switch
v-model="scope.row.stateShow" v-model="scope.row.delState"
active-text="启用" active-text="启用"
inactive-text="禁用" inactive-text="禁用"
:active-value="1"
:inactive-value="2"
@change="staShow(scope.row)" @change="staShow(scope.row)"
> >
</el-switch> </el-switch>
@ -118,7 +120,7 @@
<el-table-column <el-table-column
:resizable="true" :resizable="true"
align="center" align="center"
width="180" width="200"
label="操作" label="操作"
> >
<template #default="scope"> <template #default="scope">
@ -140,6 +142,10 @@
<svg-icon name="detail" class="icon"></svg-icon> <svg-icon name="detail" class="icon"></svg-icon>
<span class="detail">详情</span> <span class="detail">详情</span>
</span> </span>
<!-- <span class="operate">
<svg-icon name="delete" class="icon"></svg-icon>
<span class="delete">删除</span>
</span> -->
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -206,33 +212,42 @@ const getList = () => {
unitId: null, unitId: null,
}; };
getUserPage(params).then((res: any) => { getUserPage(params).then((res: any) => {
console.log(res, "res==>");
tableData.value = res.data.list; tableData.value = res.data.list;
total.value = res.data.total; total.value = res.data.total;
tableDataloading.value = false; tableDataloading.value = false;
}); });
}; };
// //
const deletelist = () => { // const deletelist = () => {
ElMessageBox.confirm("是否确认删除?", "提示", { // ElMessageBox.confirm("?", "", {
confirmButtonText: "是", // confirmButtonText: "",
cancelButtonText: "否", // cancelButtonText: "",
type: "warning", // type: "warning",
}).then(() => { // }).then(() => {
delUser(tableCheckBoxs.value.join(",")).then((res: any) => { // delUser(tableCheckBoxs.value.join(",")).then((res: any) => {
if (res.code == 1) { // if (res.code == 1) {
ElMessage.success({ // ElMessage.success({
message: "删除成功", // message: "",
type: "success", // type: "success",
}); // });
} else { // } else {
ElMessage.error({ // ElMessage.error({
message: res.message, // message: res.message,
type: "error", // type: "error",
}); // });
} // }
getList(); // getList();
}); // });
}); // });
// };
const staShow = (data) => {
let params = {
userId: data.sysuserid,
delState: data.delState,
};
delUser(params).then(() => {});
}; };
// //
const onclone = () => { const onclone = () => {
@ -250,15 +265,11 @@ onMounted(() => {
// flex: auto; // flex: auto;
background: #fff; background: #fff;
border-radius: 0.26042vw; border-radius: 0.26042vw;
box-shadow: 0 0 0.41667vw 0 rgba(8, 33, 85, 0.1); box-shadow: 0 0 0.41667vw 0 rgb(8 33 85 / 10%);
height: 100%; height: 100%;
padding: 0.83333vw; padding: 0.83333vw;
overflow-y: auto; overflow-y: auto;
overflow-x: hidden !important; overflow-x: hidden !important;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
-o-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box; box-sizing: border-box;
} }
</style> </style>

View File

@ -50,7 +50,7 @@
v-model="addPostFactorForm.sortid" v-model="addPostFactorForm.sortid"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="所在地区:" prop="areaCode" style="width: 100%"> <el-form-item label="所在地区:" prop="areaCode" style="width: 100%;">
<el-tree-select <el-tree-select
v-model="addPostFactorForm.areaCode" v-model="addPostFactorForm.areaCode"
:props="areaProps" :props="areaProps"
@ -98,7 +98,7 @@ const ruleForm = reactive<FormRules>({
{ required: true, message: "请输入组织名", trigger: "blur" }, { required: true, message: "请输入组织名", trigger: "blur" },
], ],
areaCode: [{ required: true, message: "请选择地区", trigger: "blur" }], areaCode: [{ required: true, message: "请选择地区", trigger: "blur" }],
performname: [{ required: true, message: "请输入负责人", trigger: "blur" }], // performname: [{ required: true, message: "", trigger: "blur" }],
}); });
const props = defineProps({ const props = defineProps({
@ -121,9 +121,9 @@ const emits = defineEmits(["close", "onSubmit"]);
const handleSubmit = () => { const handleSubmit = () => {
formRef.value?.validate((valid) => { formRef.value?.validate((valid) => {
if (valid) { if (valid) {
console.log(addPostFactorForm.value);
const params = JSON.parse(JSON.stringify(addPostFactorForm.value)); const params = JSON.parse(JSON.stringify(addPostFactorForm.value));
params.viewjurisdiction =
addPostFactorForm.value.viewjurisdiction.join(",");
performAdd(params).then((res: any) => { performAdd(params).then((res: any) => {
if (res.code == 1) { if (res.code == 1) {
ElMessage.success({ ElMessage.success({
@ -191,7 +191,6 @@ watch(
uuid.value = getUUID(); uuid.value = getUUID();
if (val) { if (val) {
if (!props.visible) return; if (!props.visible) return;
val.viewjurisdiction = val.viewjurisdiction?.split(",");
addPostFactorForm.value = val; addPostFactorForm.value = val;
} }
} }

View File

@ -17,7 +17,7 @@
</div> </div>
</div> </div>
</div> </div>
<div style="width: 30%"> <div style="width: 30%;">
<div> <div>
<el-input <el-input
v-model="search" v-model="search"
@ -73,7 +73,7 @@
<el-table-column <el-table-column
:resizable="true" :resizable="true"
align="center" align="center"
width="180" width="200"
label="操作" label="操作"
> >
<template #default="scope"> <template #default="scope">
@ -95,6 +95,10 @@
<svg-icon name="detail" class="icon"></svg-icon> <svg-icon name="detail" class="icon"></svg-icon>
<span class="detail">详情</span> <span class="detail">详情</span>
</span> </span>
<span class="operate" @click="clickDelete(scope.row.listperformid)">
<svg-icon name="delete" class="icon"></svg-icon>
<span class="delete">删除</span>
</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -127,7 +131,8 @@ import { onMounted, reactive, ref } from "vue";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
const router = useRouter(); const router = useRouter();
import { getListperformPage, performDel } from "@/api/Sys"; import { getListperformPage, delListperform } from "@/api/Sys";
import { ElMessage, ElMessageBox } from "element-plus";
import AddOrEdit from "./add-or-edit.vue"; import AddOrEdit from "./add-or-edit.vue";
import useUserStore from "@/store/modules/user"; import useUserStore from "@/store/modules/user";
@ -163,7 +168,29 @@ const getList = () => {
tableDataloading.value = false; tableDataloading.value = false;
}); });
}; };
const clickDelete = (listperformid)=>{
console.log(listperformid);
ElMessageBox.confirm("是否确认删除?", "提示", {
confirmButtonText: "是",
cancelButtonText: "否",
type: "warning",
}).then(() => {
delListperform(listperformid).then((res: any) => {
if (res.code == 1) {
ElMessage.success({
message: "删除成功",
type: "success",
});
} else {
ElMessage.error({
message: res.message,
type: "error",
});
}
getList();
});
});
}
// //
const onclone = () => { const onclone = () => {
dialogVisible.value = false; dialogVisible.value = false;
@ -181,17 +208,12 @@ onMounted(() => {
width: 100%; width: 100%;
background: #fff; background: #fff;
border-radius: 0.26042vw; border-radius: 0.26042vw;
box-shadow: 0 0 0.41667vw 0 rgba(8, 33, 85, 0.1); box-shadow: 0 0 0.41667vw 0 rgb(8 33 85 / 10%);
height: 100%; height: 100%;
padding: 0.83333vw; padding: 0.83333vw;
overflow-y: auto; overflow-y: auto;
overflow-x: hidden !important; overflow-x: hidden !important;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
-o-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box; box-sizing: border-box;
.table { .table {
margin-top: 16px; margin-top: 16px;
} }