From 65972957e56a31778cc1633b1032ac16627665f3 Mon Sep 17 00:00:00 2001
From: gaoshp <291585735@qq.com>
Date: 星期六, 05 十月 2024 21:28:25 +0800
Subject: [PATCH] update
---
src/locales/lang/zh-cn.js | 8
src/views/console/authority/apiscope.vue | 302 +++++++------
src/views/console/authority/datascope.vue | 564 +++++++++++++-------------
src/views/master/person/main/save.vue | 358 ++++++++--------
4 files changed, 636 insertions(+), 596 deletions(-)
diff --git a/src/locales/lang/zh-cn.js b/src/locales/lang/zh-cn.js
index 70911dd..e66e77c 100644
--- a/src/locales/lang/zh-cn.js
+++ b/src/locales/lang/zh-cn.js
@@ -1,3 +1,9 @@
+/*
+ * @Date: 2024-10-03 10:11:31
+ * @LastEditors: gaoshp
+ * @LastEditTime: 2024-10-05 21:22:00
+ * @FilePath: /cps-web/src/locales/lang/zh-cn.js
+ */
export default {
login: {
slogan: '', //棣栭〉鎻忚堪鏂囧瓧
@@ -9,7 +15,7 @@
forgetPassword: '蹇樿瀵嗙爜',
signIn: '鐧诲綍',
signInOther: '鍏朵粬鐧诲綍鏂瑰紡',
- userPlaceholder: '鐢ㄦ埛鍚� / 鎵嬫満 / 閭',
+ userPlaceholder: '鐢ㄦ埛鍚�',
userError: '璇疯緭鍏ョ敤鎴峰悕',
PWPlaceholder: '璇疯緭鍏ュ瘑鐮�',
PWError: '璇疯緭鍏ュ瘑鐮�',
diff --git a/src/views/console/authority/apiscope.vue b/src/views/console/authority/apiscope.vue
index 9f3cc80..5ff2327 100644
--- a/src/views/console/authority/apiscope.vue
+++ b/src/views/console/authority/apiscope.vue
@@ -1,21 +1,22 @@
<!--
* @Author: lzhe lzhe@example.com
* @Date: 2024-03-26 10:28:33
- * @LastEditors: lzhe lzhe@example.com
- * @LastEditTime: 2024-06-05 11:36:50
- * @FilePath: /smart-web/src/views/master/person/main/index.vue
+ * @LastEditors: gaoshp
+ * @LastEditTime: 2024-10-05 21:24:27
+ * @FilePath: /cps-web/src/views/console/authority/apiscope.vue
* @Description: 杩欐槸榛樿璁剧疆,璇疯缃甡customMade`, 鎵撳紑koroFileHeader鏌ョ湅閰嶇疆 杩涜璁剧疆: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="aposcope-main">
<div class="aposcope-left">
<div class="left-title">鑿滃崟</div>
- <el-tree :data="tableData" row-key="id" :props="defalutProps" lazy :load="loadNode" @node-click="handleNodeClick" ref="treeRef"/>
+ <el-tree :data="tableData" row-key="id" :props="defalutProps" lazy :load="loadNode"
+ @node-click="handleNodeClick" ref="treeRef" />
</div>
<div class="aposcope-right">
<div>
- <el-button type="primary" @click="addData">+ 娣诲姞</el-button>
- <el-button type="danger" plain @click="delData">鍒犻櫎</el-button>
+ <!-- <el-button type="primary" @click="addData">+ 娣诲姞</el-button> -->
+ <!-- <el-button type="danger" plain @click="delData">鍒犻櫎</el-button> -->
</div>
<div class="right-content" v-if="searchDataList.length == 0">
<div>
@@ -23,7 +24,9 @@
<!-- <span @click="addData">娣诲姞瑙勫垯</span> -->
</div>
</div>
- <el-table v-if="searchDataList.length != 0" ref="searchDataListRef" :data="searchDataList" border style="width: 100%;margin-top: 20px;" class="multipleTableRef" @selection-change="searchHandleSelectionChange">
+ <el-table v-if="searchDataList.length != 0" ref="searchDataListRef" :data="searchDataList" border
+ style="width: 100%;margin-top: 20px;" class="multipleTableRef"
+ @selection-change="searchHandleSelectionChange">
<el-table-column type="selection" width="55" />
<el-table-column prop="moduleCode" label="鎺ュ彛妯″潡"></el-table-column>
<el-table-column prop="controllerCode" label="Controller"></el-table-column>
@@ -32,16 +35,17 @@
<el-table-column prop="scopePath" label="api鍦板潃"></el-table-column>
</el-table>
</div>
- <el-drawer :title="'褰撳墠閫変腑鑿滃崟璺緞'+drawerPath" v-model="drawer" :direction="direction" :before-close="handleClose" size="780" class="drawerClass">
+ <el-drawer :title="'褰撳墠閫変腑鑿滃崟璺緞' + drawerPath" v-model="drawer" :direction="direction" :before-close="handleClose"
+ size="780" class="drawerClass">
<el-form :inline="true" :model="drawerSearchData" label-width="110px">
<el-form-item label="鎺ュ彛妯″潡">
<el-select v-model="drawerSearchData.moduleCode" style="width: 100%" size="small">
- <el-option v-for="item in aList" :key="item.id" :label="item.title" :value="item.id"/>
+ <el-option v-for="item in aList" :key="item.id" :label="item.title" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="鎺ュ彛Controller">
<el-select v-model="drawerSearchData.controllerCode" style="width: 100%" size="small">
- <el-option v-for="item in aList" :key="item.id" :label="item.title" :value="item.id"/>
+ <el-option v-for="item in aList" :key="item.id" :label="item.title" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item>
@@ -50,7 +54,8 @@
</el-form>
<div>
<div class="dict-table">
- <el-table ref="multipleTableRef" :data="drawerTableData" border style="width: 100%" class="multipleTableRef" @selection-change="drawerHandleSelectionChange">
+ <el-table ref="multipleTableRef" :data="drawerTableData" border style="width: 100%"
+ class="multipleTableRef" @selection-change="drawerHandleSelectionChange">
<el-table-column type="selection" width="55" />
<el-table-column prop="className" label="鎺ュ彛妯″潡"></el-table-column>
<el-table-column prop="controllerCode" label="Controller"></el-table-column>
@@ -68,134 +73,134 @@
</div>
</template>
<script>
- export default {
- name: "apiscope",
- data(){
- return {
- drawerPath: "",
- searchData: {
- menuId: "",
- size: "15",
- current: "1"
- },
- searchDataList: [], //鍙充晶鏁版嵁list
- aList: [],
- drawerSearchData: {
- moduleCode: "",
- controllerCode: "",
- menuId: "",
- size: "-1"
- },
- direction: "rtl",
- drawer: false,
- defalutProps: {
- label: 'name',
- children: 'children',
- isLeaf: 'hasChildren'
- },
- parentId: "0",
- tableData: [],
- searchSelection: []
- }
- },
- created(){
-
- },
- mounted(){
- //this.getMenuList();
- },
- components: {
+export default {
+ name: "apiscope",
+ data() {
+ return {
+ drawerPath: "",
+ searchData: {
+ menuId: "",
+ size: "15",
+ current: "1"
+ },
+ searchDataList: [], //鍙充晶鏁版嵁list
+ aList: [],
+ drawerSearchData: {
+ moduleCode: "",
+ controllerCode: "",
+ menuId: "",
+ size: "-1"
+ },
+ direction: "rtl",
+ drawer: false,
+ defalutProps: {
+ label: 'name',
+ children: 'children',
+ isLeaf: 'hasChildren'
+ },
+ parentId: "0",
+ tableData: [],
+ searchSelection: []
+ }
+ },
+ created() {
- },
- methods: {
- closeDrawer() {
- this.drawer = false;
- },
- drawerConfirm() {
- this.drawer = false;
- },
- searchHandleSelectionChange(selection) {
- this.searchSelection = selection;
- },
- drawerHandleSelectionChange() {
+ },
+ mounted() {
+ //this.getMenuList();
+ },
+ components: {
- },
- drawerSearchclick() {
- this.drawerSearchData.menuId = this.searchData.menuId;
- var obj = {};
- for(var key in this.drawerSearchData) {
- if(this.drawerSearchData[key]) {
- obj[key] = this.drawerSearchData[key];
- }
+ },
+ methods: {
+ closeDrawer() {
+ this.drawer = false;
+ },
+ drawerConfirm() {
+ this.drawer = false;
+ },
+ searchHandleSelectionChange(selection) {
+ this.searchSelection = selection;
+ },
+ drawerHandleSelectionChange() {
+
+ },
+ drawerSearchclick() {
+ this.drawerSearchData.menuId = this.searchData.menuId;
+ var obj = {};
+ for (var key in this.drawerSearchData) {
+ if (this.drawerSearchData[key]) {
+ obj[key] = this.drawerSearchData[key];
}
- this.$HTTP.get("/api/blade-system/resource-definition/page",obj).then(res=> {
- if(res.code == 200) {
- this.drawerTableData = res.data.records;
- }
- })
- },
- handleClose(done) {
- done();
- },
- handleNodeClick(data) {
- this.drawerPath = data.name;
- console.log(data,data.name,222)
- this.searchData.menuId = data.id;
- this.$HTTP.get("/api/blade-system/api-scope/list",this.searchData).then(res=> {
- if(res.code == 200) {
- this.searchDataList = res.data.records;
- }
- })
- },
- getMenuList() {
- this.$HTTP.get("/api/blade-system/menu/lazy-list?parentId=0").then(res=> {
- if(res.code == 200) {
- this.tableData = res.data;
- }
- })
- },
- loadNode(node, resolve, reject) {
- if(node.data.id) {
- this.parentId = node.data.id;
- }else {
- this.parentId = '0';
- }
- this.$HTTP.get("/api/blade-system/menu/lazy-list",{parentId: this.parentId}).then(res=> {
- if(res.code == 200) {
- res.data.forEach(node => {
- node.hasChildren = !node.hasChildren;
- });
- resolve(res.data);
- }
- })
- },
- addData() {
- this.drawerSearchclick();
- this.drawer = true;
- },
- delData() {
- if(this.searchSelection.length == 0) {
- this.$message({
- message: '璇烽�夋嫨鑷冲皯涓�鏉℃暟鎹�',
- type: 'warning'
- });
- return;
- }
- var selStr = "";
- this.searchSelection.map(item=> {
- selStr += item.id + ","
- })
- selStr = selStr.replace(/,$/, '');
- var that = this;
- // this.$HTTP.post("/api/blade-system/data-scope/remove?ids="+selStr).then(res=> {
- // if(res.code == 200) {
- // that.$message.success("鎿嶄綔鎴愬姛");
- // that.drawerSearchclick();
- // }
- // })
}
+ this.$HTTP.get("/api/blade-system/resource-definition/page", obj).then(res => {
+ if (res.code == 200) {
+ this.drawerTableData = res.data.records;
+ }
+ })
+ },
+ handleClose(done) {
+ done();
+ },
+ handleNodeClick(data) {
+ this.drawerPath = data.name;
+ console.log(data, data.name, 222)
+ this.searchData.menuId = data.id;
+ this.$HTTP.get("/api/blade-system/api-scope/list", this.searchData).then(res => {
+ if (res.code == 200) {
+ this.searchDataList = res.data.records;
+ }
+ })
+ },
+ getMenuList() {
+ this.$HTTP.get("/api/blade-system/menu/lazy-list?parentId=0").then(res => {
+ if (res.code == 200) {
+ this.tableData = res.data;
+ }
+ })
+ },
+ loadNode(node, resolve, reject) {
+ if (node.data.id) {
+ this.parentId = node.data.id;
+ } else {
+ this.parentId = '0';
+ }
+ this.$HTTP.get("/api/blade-system/menu/lazy-list", { parentId: this.parentId }).then(res => {
+ if (res.code == 200) {
+ res.data.forEach(node => {
+ node.hasChildren = !node.hasChildren;
+ });
+ resolve(res.data);
+ }
+ })
+ },
+ addData() {
+ this.drawerSearchclick();
+ this.drawer = true;
+ },
+ delData() {
+ if (this.searchSelection.length == 0) {
+ this.$message({
+ message: '璇烽�夋嫨鑷冲皯涓�鏉℃暟鎹�',
+ type: 'warning'
+ });
+ return;
+ }
+ var selStr = "";
+ this.searchSelection.map(item => {
+ selStr += item.id + ","
+ })
+ selStr = selStr.replace(/,$/, '');
+ var that = this;
+ // this.$HTTP.post("/api/blade-system/data-scope/remove?ids="+selStr).then(res=> {
+ // if(res.code == 200) {
+ // that.$message.success("鎿嶄綔鎴愬姛");
+ // that.drawerSearchclick();
+ // }
+ // })
}
}
+}
</script>
<style scoped>
@@ -204,48 +209,59 @@
min-height: 100%;
margin: 8px;
}
+
.aposcope-left {
width: 240px;
margin-right: 8px;
padding: 4px;
background-color: #fff;
}
+
.aposcope-right {
flex: 1;
padding: 8px;
background-color: #fff;
}
+
.left-title {
font-size: 16px;
- text-align: center;
- height: 38px;
- line-height: 38px;
- border-bottom: 1px solid #e2e2e2;
- background-color: #409eff;
- color: #fff;
- border-radius: 2px 2px 0 0;
+ text-align: center;
+ height: 38px;
+ line-height: 38px;
+ border-bottom: 1px solid #e2e2e2;
+ background-color: #409eff;
+ color: #fff;
+ border-radius: 2px 2px 0 0;
}
+
.right-content {
text-align: center;
}
+
.right-content img {
width: 350px;
height: 350px;
}
-.right-content > div {
- font-size: 14px;;
+
+.right-content>div {
+ font-size: 14px;
+ ;
}
-.right-content > div span:nth-child(2) {
+
+.right-content>div span:nth-child(2) {
margin-left: 8px;
color: #409eff;
cursor: pointer;
}
+
/deep/ .drawerClass {
padding: 8px;
}
+
.datascope-drawer-btn {
margin-bottom: 8px;
}
+
.drawer-foot {
margin-top: 20px;
}
diff --git a/src/views/console/authority/datascope.vue b/src/views/console/authority/datascope.vue
index 09b2e06..e83e530 100644
--- a/src/views/console/authority/datascope.vue
+++ b/src/views/console/authority/datascope.vue
@@ -1,9 +1,9 @@
<!--
* @Author: lzhe lzhe@example.com
* @Date: 2024-03-26 10:28:33
- * @LastEditors: lzhe lzhe@example.com
- * @LastEditTime: 2024-04-02 17:48:31
- * @FilePath: /smart-web/src/views/master/person/main/index.vue
+ * @LastEditors: gaoshp
+ * @LastEditTime: 2024-10-05 21:26:31
+ * @FilePath: /cps-web/src/views/console/authority/datascope.vue
* @Description: 杩欐槸榛樿璁剧疆,璇疯缃甡customMade`, 鎵撳紑koroFileHeader鏌ョ湅閰嶇疆 杩涜璁剧疆: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
@@ -15,12 +15,12 @@
<el-form-item label="鑿滃崟缂栧彿">
<el-input v-model="searchData.code" placeholder="鑿滃崟缂栧彿" clearable></el-input>
</el-form-item>
- <el-form-item label="鎵�灞炲簲鐢�">
+ <!-- <el-form-item label="鎵�灞炲簲鐢�">
<el-select v-model="searchData.belongApplication" style="width: 100%">
- <el-option key="CPS" label="CPS" value="CPS"/>
- <el-option key="FMS" label="FMS" value="FMS"/>
+ <el-option key="CPS" label="CPS" value="CPS" />
+ <el-option key="FMS" label="FMS" value="FMS" />
</el-select>
- </el-form-item>
+ </el-form-item> -->
<el-form-item>
<el-button type="primary" @click="searchclick">鎼滅储</el-button>
<el-button @click="searchClearBtn">娓呯┖</el-button>
@@ -28,34 +28,38 @@
</el-form>
<div>
<div class="dict-table">
- <el-table ref="multipleTableRef" :data="tableData" border row-key="id" style="width: 100%" class="multipleTableRef" @selection-change="handleSelectionChange" :tree-props="{ children: 'children', hasChildren: 'has' }">
+ <el-table ref="multipleTableRef" :data="tableData" border row-key="id" style="width: 100%"
+ class="multipleTableRef" @selection-change="handleSelectionChange"
+ :tree-props="{ children: 'children', hasChildren: 'has' }">
<el-table-column type="selection" width="55" />
<el-table-column prop="name" label="鑿滃崟鍚嶇О"></el-table-column>
<el-table-column prop="path" label="璺敱鍦板潃"></el-table-column>
<el-table-column prop="source" label="鑿滃崟鍥炬爣">
<template #default="scope">
- <component v-if="icons.includes(scope.row.source)" style="width: 20px;height: 20px;"
- :is='scope.row.source'></component>
- </template>
+ <component v-if="icons.includes(scope.row.source)" style="width: 20px;height: 20px;"
+ :is='scope.row.source'></component>
+ </template>
</el-table-column>
<el-table-column prop="code" label="鑿滃崟缂栧彿"></el-table-column>
<el-table-column prop="alias" label="鑿滃崟鍒悕"></el-table-column>
<el-table-column prop="sort" label="鑿滃崟鎺掑簭"></el-table-column>
<el-table-column prop="isOpen" label="鏂扮獥鍙�">
<template #default="scope">
- <div>{{scope.row.isOpen == 0?"鏄�":"鍚�"}}</div>
+ <div>{{ scope.row.isOpen == 0 ? "鏄�" : "鍚�" }}</div>
</template>
</el-table-column>
- <el-table-column prop="belongApplication" label="鎵�灞炲簲鐢�"></el-table-column>
+ <!-- <el-table-column prop="belongApplication" label="鎵�灞炲簲鐢�"></el-table-column> -->
<el-table-column fixed="right" label="鎿嶄綔">
<template #default="scope">
- <el-button text type="primary" size="small" @click="showDrawer(scope.row, scope.$index)">鏉冮檺閰嶇疆</el-button>
+ <el-button text type="primary" size="small"
+ @click="showDrawer(scope.row, scope.$index)">鏉冮檺閰嶇疆</el-button>
</template>
</el-table-column>
</el-table>
</div>
</div>
- <el-drawer title="[鎺у埗涓績]鏁版嵁鏉冮檺閰嶇疆" v-model="drawer" :direction="direction" :before-close="handleClose" size="920" class="drawerStyle">
+ <el-drawer title="[鎺у埗涓績]鏁版嵁鏉冮檺閰嶇疆" v-model="drawer" :direction="direction" :before-close="handleClose" size="920"
+ class="drawerStyle">
<el-form :inline="true" :model="drawerSearchData" label-width="120px">
<el-form-item label="鑿滃崟鍚嶇О">
<el-input v-model="drawerSearchData.scopeName" placeholder="鑿滃崟鍚嶇О" clearable />
@@ -74,7 +78,8 @@
<el-button type="danger" plain @click="delData">鍒犻櫎</el-button>
</div>
<div class="dict-table">
- <el-table ref="multipleTableRef" :data="drawerTableData" border style="width: 100%" class="multipleTableRef" @selection-change="drawerHandleSelectionChange">
+ <el-table ref="multipleTableRef" :data="drawerTableData" border style="width: 100%"
+ class="multipleTableRef" @selection-change="drawerHandleSelectionChange">
<el-table-column type="selection" width="55" />
<el-table-column prop="scopeName" label="鏉冮檺鍚嶇О"></el-table-column>
<el-table-column prop="resourceCode" label="鏉冮檺缂栧彿"></el-table-column>
@@ -82,290 +87,295 @@
<el-table-column prop="scopeTypeName" label="瑙勫垯鍒嗙被"></el-table-column>
<el-table-column fixed="right" label="鎿嶄綔">
<template #default="scope">
- <el-button text type="primary" size="small" @click="table_show(scope.row, scope.$index)">鏌ョ湅</el-button>
- <el-button text type="primary" size="small" @click="table_edit(scope.row, scope.$index)">缂栬緫</el-button>
- <el-button text type="primary" size="small" @click="table_del(scope.row, scope.$index)">鍒犻櫎</el-button>
+ <el-button text type="primary" size="small"
+ @click="table_show(scope.row, scope.$index)">鏌ョ湅</el-button>
+ <el-button text type="primary" size="small"
+ @click="table_edit(scope.row, scope.$index)">缂栬緫</el-button>
+ <el-button text type="primary" size="small"
+ @click="table_del(scope.row, scope.$index)">鍒犻櫎</el-button>
</template>
</el-table-column>
</el-table>
- <el-pagination
- style="margin-top: 12px;"
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :current-page="currentPage4"
- :page-sizes="[15, 50, 100]"
- :page-size="15"
- layout="total, sizes, prev, pager, next, jumper"
- :total="drawerTotal">
+ <el-pagination style="margin-top: 12px;" @size-change="handleSizeChange"
+ @current-change="handleCurrentChange" :current-page="currentPage4" :page-sizes="[15, 50, 100]"
+ :page-size="15" layout="total, sizes, prev, pager, next, jumper" :total="drawerTotal">
</el-pagination>
</div>
</div>
</el-drawer>
- <save-dialog v-if="dialog.save" ref="saveDialog" :scopeTypeNameList="scopeTypeNameList" :tableRow="tableRow" @success="addDatascopeSuccess" @closed="dialog.save=false"></save-dialog>
+ <save-dialog v-if="dialog.save" ref="saveDialog" :scopeTypeNameList="scopeTypeNameList" :tableRow="tableRow"
+ @success="addDatascopeSuccess" @closed="dialog.save = false"></save-dialog>
</div>
</template>
<script>
- import saveDialog from './addDatascope'
- import * as ElementPlusIconsVue from '@element-plus/icons-vue'
- let icons = []
- for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
- icons.push(key)
- }
- export default {
- name: "datascope",
- data(){
- return {
- scopeTypeNameList: [],
- dialog: {
- save: false
- },
- drawerTotal: 0,
- direction: "rtl",
- drawer: false,
- icons,
- belongApplicationList: [],
- fileDialogVisible: false,
- getModalData: [],
- selection: [],
- drawerSelection: [],
- total: 0,
- drawerSearchData: {
- scopeName: "",
- resourceCode: "",
- menuId: "",
- current: 1,
- size: 10
- },
- searchData: {
- name: "",
- code: "",
- belongApplication: "",
- parentId: ""
- },
- dialog: {
- save: false,
- allocation: false
- },
- tableData: [],
- drawerTableData: [],
- rowId: "",
- tableRow: {}
- }
- },
- created(){
-
- },
- mounted(){
- this.getscopeTypeNameList();//瑙勫垯鍒嗙被鏋氫妇
- this.searchBtn();
- },
- components: {
- ...ElementPlusIconsVue,saveDialog
- },
- methods: {
- getscopeTypeNameList() { //瑙勫垯鍒嗙被鏋氫妇
- this.$HTTP.get("/api/blade-system/dict/dictionary?code=data_scope_type").then(res=> {
- if(res.code == 200) {
- this.scopeTypeNameList = res.data;
- }
- })
+import saveDialog from './addDatascope'
+import * as ElementPlusIconsVue from '@element-plus/icons-vue'
+let icons = []
+for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
+ icons.push(key)
+}
+export default {
+ name: "datascope",
+ data() {
+ return {
+ scopeTypeNameList: [],
+ dialog: {
+ save: false
},
- addDatascopeSuccess() {
- this.drawerSearchclick();
+ drawerTotal: 0,
+ direction: "rtl",
+ drawer: false,
+ icons,
+ belongApplicationList: [],
+ fileDialogVisible: false,
+ getModalData: [],
+ selection: [],
+ drawerSelection: [],
+ total: 0,
+ drawerSearchData: {
+ scopeName: "",
+ resourceCode: "",
+ menuId: "",
+ current: 1,
+ size: 10
},
- //娣诲姞鏉冮檺
- addData(){
- this.dialog.save = true
- this.$nextTick(() => {
- this.$refs.saveDialog.open()
- })
+ searchData: {
+ name: "",
+ code: "",
+ belongApplication: "CPS",
+ parentId: ""
},
- // 鍒犻櫎
- delData() {
- if(this.drawerSelection.length == 0) {
- this.$message({
- message: '璇烽�夋嫨鑷冲皯涓�鏉℃暟鎹�',
- type: 'warning'
- });
- return;
+ dialog: {
+ save: false,
+ allocation: false
+ },
+ tableData: [],
+ drawerTableData: [],
+ rowId: "",
+ tableRow: {}
+ }
+ },
+ created() {
+
+ },
+ mounted() {
+ this.getscopeTypeNameList();//瑙勫垯鍒嗙被鏋氫妇
+ this.searchBtn();
+ },
+ components: {
+ ...ElementPlusIconsVue, saveDialog
+ },
+ methods: {
+ getscopeTypeNameList() { //瑙勫垯鍒嗙被鏋氫妇
+ this.$HTTP.get("/api/blade-system/dict/dictionary?code=data_scope_type").then(res => {
+ if (res.code == 200) {
+ this.scopeTypeNameList = res.data;
}
- var selStr = "";
- this.drawerSelection.map(item=> {
- selStr += item.id + ","
- })
- selStr = selStr.replace(/,$/, '');
- var that = this;
- this.$HTTP.post("/api/blade-system/data-scope/remove?ids="+selStr).then(res=> {
- if(res.code == 200) {
+ })
+ },
+ addDatascopeSuccess() {
+ this.drawerSearchclick();
+ },
+ //娣诲姞鏉冮檺
+ addData() {
+ this.dialog.save = true
+ this.$nextTick(() => {
+ this.$refs.saveDialog.open()
+ })
+ },
+ // 鍒犻櫎
+ delData() {
+ if (this.drawerSelection.length == 0) {
+ this.$message({
+ message: '璇烽�夋嫨鑷冲皯涓�鏉℃暟鎹�',
+ type: 'warning'
+ });
+ return;
+ }
+ var selStr = "";
+ this.drawerSelection.map(item => {
+ selStr += item.id + ","
+ })
+ selStr = selStr.replace(/,$/, '');
+ var that = this;
+ this.$HTTP.post("/api/blade-system/data-scope/remove?ids=" + selStr).then(res => {
+ if (res.code == 200) {
+ that.$message.success("鎿嶄綔鎴愬姛");
+ that.drawerSearchclick();
+ }
+ })
+ },
+ table_edit(row) { //缂栬緫
+ this.dialog.save = true
+ this.$HTTP.get("/api/blade-system/data-scope/detail?id=" + row.id).then(res => {
+ if (res.code == 200) {
+ this.dialog.save = true;
+ this.$nextTick(() => {
+ this.$refs.saveDialog.open('edit').setData(res.data);
+ })
+ }
+ })
+ },
+ //鏌ョ湅
+ table_show(row) { //鏌ョ湅
+ this.dialog.save = true
+ this.$nextTick(() => {
+ this.$refs.saveDialog.open('show').setData(row)
+ })
+ },
+ table_del(row) {
+ var that = this;
+ this.$confirm(`纭畾灏嗛�夋嫨鏁版嵁鍒犻櫎?`, '', {
+ type: 'warning'
+ }).then(() => {
+ this.$HTTP.post("/api/blade-system/data-scope/remove?ids=" + row.id).then(res => {
+ if (res.code == 200) {
that.$message.success("鎿嶄綔鎴愬姛");
that.drawerSearchclick();
}
})
- },
- table_edit(row){ //缂栬緫
- this.dialog.save = true
- this.$HTTP.get("/api/blade-system/data-scope/detail?id="+row.id).then(res=> {
- if(res.code == 200) {
- this.dialog.save = true;
- this.$nextTick(() => {
- this.$refs.saveDialog.open('edit').setData(res.data);
- })
- }
- })
- },
- //鏌ョ湅
- table_show(row){ //鏌ョ湅
- this.dialog.save = true
- this.$nextTick(() => {
- this.$refs.saveDialog.open('show').setData(row)
- })
- },
- table_del(row) {
- var that = this;
- this.$confirm(`纭畾灏嗛�夋嫨鏁版嵁鍒犻櫎?`, '', {
- type: 'warning'
- }).then(() => {
- this.$HTTP.post("/api/blade-system/data-scope/remove?ids="+row.id).then(res=> {
- if(res.code == 200) {
- that.$message.success("鎿嶄綔鎴愬姛");
- that.drawerSearchclick();
- }
- })
- }).catch(() => {
+ }).catch(() => {
- })
- },
- handleClose(done) {
- this.drawerTableData = [];
- done();
- },
- exportFile(row,index){
- window.open(row.link);
- },
- codeClick() {
-
- },
- searchClearBtn() {
- this.searchData = {
- name: "",
- code: "",
- belongApplication: "",
- parentId: ""
- }
- this.searchBtn();
- },
- showDrawer(row){
- this.rowId = row.id;
- this.tableRow = row; //鍚庨潰缁勪欢浼氱敤鍒�
- this.drawerSearchclick();
- this.drawer = true;
- },
- drawerSearchclick() {
- var obj = {};
- for(var key in this.drawerSearchData) {
- if(this.drawerSearchData[key]) {
- obj[key] = this.drawerSearchData[key];
- }
- }
- obj.menuId = this.rowId;
- this.$HTTP.get("/api/blade-system/data-scope/list?"+this.$TOOL.qsStringify(obj)).then(res=> {
- if(res.code == 200) {
- this.drawerTableData = res.data.records;
- this.drawerTotal = res.data.total;
- }
- })
- },
- drawerSearchClearBtn() {
- this.drawerSearchData = {
- scopeName: "",
- resourceCode: "",
- menuId: this.rowId,
- current: 1,
- size: 10
- }
- this.drawerSearchclick();
- },
- searchclick() {
- this.searchBtn();
- },
- searchBtn() {
- var obj = {};
- for(var key in this.searchData) {
- if(this.searchData[key]) {
- obj[key] = this.searchData[key];
- }
- }
- this.$HTTP.get("/api/blade-system/menu/lazy-menu-list",obj).then(res=> {
- if(res.code == 200) {
- this.tableData = res.data;
- }
- })
- },
- handleSelectionChange(selection) {
- this.selection = selection;
- },
- drawerHandleSelectionChange(selection) {
- this.drawerSelection = selection;
- },
- changeDepartment() {
- this.departmentVisible = true;
- },
- handleSizeChange(val) {
- console.log(`姣忛〉 ${val} 鏉);
- this.drawerSearchData.current = "1";
- this.drawerSearchData.size = val;
- this.drawerSearchclick();
- },
- handleCurrentChange(val) {
- console.log(`褰撳墠椤�: ${val}`);
- this.drawerSearchData.current = val;
- this.drawerSearchclick();
+ })
+ },
+ handleClose(done) {
+ this.drawerTableData = [];
+ done();
+ },
+ exportFile(row, index) {
+ window.open(row.link);
+ },
+ codeClick() {
+
+ },
+ searchClearBtn() {
+ this.searchData = {
+ name: "",
+ code: "",
+ belongApplication: "",
+ parentId: ""
}
+ this.searchBtn();
+ },
+ showDrawer(row) {
+ this.rowId = row.id;
+ this.tableRow = row; //鍚庨潰缁勪欢浼氱敤鍒�
+ this.drawerSearchclick();
+ this.drawer = true;
+ },
+ drawerSearchclick() {
+ var obj = {};
+ for (var key in this.drawerSearchData) {
+ if (this.drawerSearchData[key]) {
+ obj[key] = this.drawerSearchData[key];
+ }
+ }
+ obj.menuId = this.rowId;
+ this.$HTTP.get("/api/blade-system/data-scope/list?" + this.$TOOL.qsStringify(obj)).then(res => {
+ if (res.code == 200) {
+ this.drawerTableData = res.data.records;
+ this.drawerTotal = res.data.total;
+ }
+ })
+ },
+ drawerSearchClearBtn() {
+ this.drawerSearchData = {
+ scopeName: "",
+ resourceCode: "",
+ menuId: this.rowId,
+ current: 1,
+ size: 10
+ }
+ this.drawerSearchclick();
+ },
+ searchclick() {
+ this.searchBtn();
+ },
+ searchBtn() {
+ var obj = {};
+ for (var key in this.searchData) {
+ if (this.searchData[key]) {
+ obj[key] = this.searchData[key];
+ }
+ }
+ this.$HTTP.get("/api/blade-system/menu/lazy-menu-list", obj).then(res => {
+ if (res.code == 200) {
+ this.tableData = res.data;
+ }
+ })
+ },
+ handleSelectionChange(selection) {
+ this.selection = selection;
+ },
+ drawerHandleSelectionChange(selection) {
+ this.drawerSelection = selection;
+ },
+ changeDepartment() {
+ this.departmentVisible = true;
+ },
+ handleSizeChange(val) {
+ console.log(`姣忛〉 ${val} 鏉);
+ this.drawerSearchData.current = "1";
+ this.drawerSearchData.size = val;
+ this.drawerSearchclick();
+ },
+ handleCurrentChange(val) {
+ console.log(`褰撳墠椤�: ${val}`);
+ this.drawerSearchData.current = val;
+ this.drawerSearchclick();
}
}
+}
</script>
<style scoped>
- .dict-main {
- background-color: #fff;
- margin: 8px;
- padding: 8px;
- }
- .dict-Btn {
- display: flex;
- justify-content: space-between;
- border-bottom: 1px solid #dcdfe6;
- margin-bottom: 8px;
- padding-left: 8px;
- padding-right: 8px;
- }
- .dict-btn-bottom {
- padding-left: 8px;
- padding-right: 8px;
- margin-bottom: 8px;
- }
- .dict-table {
- padding-left: 8px;
- padding-right: 8px;
- margin-bottom: 8px;
-
- }
- .multipleTableRef {
- margin-bottom: 8px;
- }
- .attachSize {
- color:#409eff;
- padding: 0 10px;
- font-size: 12px;
- background-color: #ebf4f4;
- border: 1px solid #d8e8e8;
- }
- /deep/ .drawerStyle {
- padding: 20px;
- }
- .datascope-drawer-btn {
- margin-bottom: 8px;
- padding-left: 8px;
- padding-right: 8px;
- }
+.dict-main {
+ background-color: #fff;
+ margin: 8px;
+ padding: 8px;
+}
+
+.dict-Btn {
+ display: flex;
+ justify-content: space-between;
+ border-bottom: 1px solid #dcdfe6;
+ margin-bottom: 8px;
+ padding-left: 8px;
+ padding-right: 8px;
+}
+
+.dict-btn-bottom {
+ padding-left: 8px;
+ padding-right: 8px;
+ margin-bottom: 8px;
+}
+
+.dict-table {
+ padding-left: 8px;
+ padding-right: 8px;
+ margin-bottom: 8px;
+
+}
+
+.multipleTableRef {
+ margin-bottom: 8px;
+}
+
+.attachSize {
+ color: #409eff;
+ padding: 0 10px;
+ font-size: 12px;
+ background-color: #ebf4f4;
+ border: 1px solid #d8e8e8;
+}
+
+/deep/ .drawerStyle {
+ padding: 20px;
+}
+
+.datascope-drawer-btn {
+ margin-bottom: 8px;
+ padding-left: 8px;
+ padding-right: 8px;
+}
</style>
diff --git a/src/views/master/person/main/save.vue b/src/views/master/person/main/save.vue
index 585b4c7..f043da6 100644
--- a/src/views/master/person/main/save.vue
+++ b/src/views/master/person/main/save.vue
@@ -1,6 +1,7 @@
<template>
<el-dialog :title="titleMap[mode]" v-model="visible" :width="800" destroy-on-close @closed="$emit('closed')">
- <el-form :model="addPersonForm" :rules="addPersonRules" :disabled="mode=='show'" ref="dialogForm" label-width="120px" label-position="center">
+ <el-form :model="addPersonForm" :rules="addPersonRules" :disabled="mode == 'show'" ref="dialogForm"
+ label-width="120px" label-position="center">
<el-row>
<el-col :span="12">
<el-form-item label="宸ュ彿" prop="jobNumber">
@@ -20,14 +21,16 @@
<el-col :span="12">
<el-form-item label="鐘舵��" prop="status">
<el-select v-model="addPersonForm.status" placeholder="鐘舵��" style="width:100%;">
- <el-option v-for="item in statusList" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" size="small"/>
+ <el-option v-for="item in statusList" :key="item.dictKey" :label="item.dictValue"
+ :value="item.dictKey" size="small" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="宀椾綅">
<el-select v-model="addPersonForm.postId" multiple style="width: 100%">
- <el-option v-for="item in postList" :key="item.id" :label="item.postName" :value="item.id"/>
+ <el-option v-for="item in postList" :key="item.id" :label="item.postName"
+ :value="item.id" />
</el-select>
</el-form-item>
</el-col>
@@ -38,212 +41,217 @@
</el-col>
<el-col :span="12">
<el-form-item label="閮ㄩ棬">
- <el-tree-select @change= "parentIdChange" v-model="addPersonForm.organizationId" clearable placeholder="涓婄骇閮ㄩ棬" default-expand-all check-on-click-nod :data="departmentList" check-strictly :props="{ label: 'name' }" node-key="id" ref="parentTree" style="width: 100%" />
+ <el-tree-select @change="parentIdChange" v-model="addPersonForm.organizationId" clearable
+ placeholder="涓婄骇閮ㄩ棬" default-expand-all check-on-click-nod :data="departmentList"
+ check-strictly :props="{ label: 'name' }" node-key="id" ref="parentTree"
+ style="width: 100%" />
</el-form-item>
</el-col>
- <el-col :span="12">
+ <!-- <el-col :span="12">
<el-form-item label="PIN鐮�" prop="pinCode">
<el-input v-model="addPersonForm.pinCode" placeholder="PIN鐮�" clearable></el-input>
</el-form-item>
- </el-col>
+ </el-col> -->
<el-col :span="12">
<el-form-item label="鍏ヨ亴鏃堕棿">
- <el-date-picker style="width: 100%;" v-model="addPersonForm.hireDate" type="date" placeholder="鍏ヨ亴鏃堕棿" value-format="YYYY-MM-DD" :size="size"/>
+ <el-date-picker style="width: 100%;" v-model="addPersonForm.hireDate" type="date"
+ placeholder="鍏ヨ亴鏃堕棿" value-format="YYYY-MM-DD" :size="size" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="鍏宠仈璐﹀彿">
<el-select v-model="addPersonForm.userId" filterable style="width: 100%" placeholder="鍏宠仈璐﹀彿">
- <el-option v-for="item in userIdList" :key="item.id" :label="item.account" :value="item.id"/>
+ <el-option v-for="item in userIdList" :key="item.id" :label="item.account"
+ :value="item.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="鏁版嵁鏉冮檺閰嶇疆">
- <el-select v-model="addPersonForm.deptId" multiple filterable style="width: 100%" placeholder="鏁版嵁鏉冮檺閰嶇疆" @change="deptIdChange">
- <el-option v-for="item in deptIdList" :key="item.id" :label="item.title" :value="item.id"/>
+ <el-select v-model="addPersonForm.deptId" multiple filterable style="width: 100%"
+ placeholder="鏁版嵁鏉冮檺閰嶇疆" @change="deptIdChange">
+ <el-option v-for="item in deptIdList" :key="item.id" :label="item.title" :value="item.id" />
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
- <el-button @click="visible=false" >鍙� 娑�</el-button>
- <el-button v-if="mode!='show'" type="primary" :loading="isSaveing" @click="saveSubmit()">淇� 瀛�</el-button>
+ <el-button @click="visible = false">鍙� 娑�</el-button>
+ <el-button v-if="mode != 'show'" type="primary" :loading="isSaveing" @click="saveSubmit()">淇� 瀛�</el-button>
</template>
</el-dialog>
</template>
<script>
- export default {
- emits: ['success', 'closed'],
- data() {
- return {
- departmentList: [],
- parentData: {},
- selectedIds: [],
- deptIdList: [],
- userIdList: [],
- organizationList: [],
- postList: [],
- statusList: [],
- mode: "add",
- titleMap: {
- add: '娣诲姞鍛樺伐',
- edit: '淇敼鍛樺伐',
- show: '鏌ョ湅'
- },
- visible: false,
- isSaveing: false,
- //琛ㄥ崟鏁版嵁
- addPersonForm: {
- jobNumber: "",
- name: "",
- tel: "",
- status: "",
- postId: "",
- email: "",
- organizationId: [],
- pinCode: "",
- hireDate: "",
- jobNumber: "",
- deptId: "",
- userId: ""
- },
- //楠岃瘉瑙勫垯
- addPersonRules: {
- jobNumber:[{required: true, message: '璇疯緭鍏ュ伐鍙�'}],
- name:[{required: true, message: '璇疯緭鍏ュ鍚�'}],
- tel:[{required: true, message: '璇疯緭鍏ユ墜鏈哄彿'}],
- status:[{required: true, message: '璇烽�夋嫨鐘舵��', trigger: 'change'}],
- pinCode:[{required: true, message: '璇疯緭鍏IN鐮�'}],
- },
- //鎵�闇�鏁版嵁閫夐」
- groups: [],
- groupsProps: {
- value: "id",
- multiple: true,
- checkStrictly: true
- },
- depts: [],
- deptsProps: {
- value: "id",
- checkStrictly: true
- }
- }
- },
- mounted() {
- this.getStatus();
- this.getpost(); //宀椾綅
- this.getOrganizationList(); //閮ㄩ棬
- this.getUserId(); //鍏宠仈璐﹀彿
- this.getdeptId(); //鏁版嵁鏉冮檺璋冩暣
- },
- methods: {
- parentIdChange(val) {
- // var $parentId = this.$refs.parentTree.getCurrentNode().title;
- // this.depatmentForm.$parentId = $parentId;
+export default {
+ emits: ['success', 'closed'],
+ data() {
+ return {
+ departmentList: [],
+ parentData: {},
+ selectedIds: [],
+ deptIdList: [],
+ userIdList: [],
+ organizationList: [],
+ postList: [],
+ statusList: [],
+ mode: "add",
+ titleMap: {
+ add: '娣诲姞鍛樺伐',
+ edit: '淇敼鍛樺伐',
+ show: '鏌ョ湅'
},
- getdeptId() { //鏁版嵁鏉冮檺璋冩暣
- this.$HTTP.get(`/api/blade-system/data-scope-manager/tree`).then(res=> {
- if(res.code == 200) {
- this.deptIdList = res.data;
- }
- })
+ visible: false,
+ isSaveing: false,
+ //琛ㄥ崟鏁版嵁
+ addPersonForm: {
+ jobNumber: "",
+ name: "",
+ tel: "",
+ status: "",
+ postId: "",
+ email: "",
+ organizationId: [],
+ // pinCode: "",
+ hireDate: "",
+ jobNumber: "",
+ deptId: "",
+ userId: ""
},
- getUserId() { //鍏宠仈璐﹀彿
- this.$HTTP.get(`/api/blade-user/unbind-account?tel=`).then(res=> {
- if(res.code == 200) {
- this.userIdList = res.data;
- }
- })
+ //楠岃瘉瑙勫垯
+ addPersonRules: {
+ jobNumber: [{ required: true, message: '璇疯緭鍏ュ伐鍙�' }],
+ name: [{ required: true, message: '璇疯緭鍏ュ鍚�' }],
+ tel: [{ required: true, message: '璇疯緭鍏ユ墜鏈哄彿' }],
+ status: [{ required: true, message: '璇烽�夋嫨鐘舵��', trigger: 'change' }],
+ // pinCode: [{ required: true, message: '璇疯緭鍏IN鐮�' }],
},
- getOrganizationList() {
- this.$HTTP.get(`/api/blade-cps/organization/tree?groupType=group_organization&groupCategory=1`).then(res=> {
- if(res.code == 200) {
- this.departmentList = res.data;
- this.addPersonForm.organizationId = res.data[0].id;
- }
- })
+ //鎵�闇�鏁版嵁閫夐」
+ groups: [],
+ groupsProps: {
+ value: "id",
+ multiple: true,
+ checkStrictly: true
},
- getpost() { //宀椾綅
- this.$HTTP.get(`/api/blade-system/post/page?current=1&size=-1`).then(res=> {
- if(res.code == 200) {
- this.postList = res.data.records;
- }
- })
- },
- getStatus() { //鑾峰彇鍏ㄩ儴璐﹀彿
- this.$HTTP.get(`/api/blade-system/dict/dictionary?code=employee_status`).then(res=> {
- if(res.code == 200) {
- this.statusList = res.data;
- res.data.forEach(item=> {
- if(item.dictValue == "鍦ㄨ亴") {
- this.addPersonForm.status = item.dictKey;
- }
- })
- }
- })
- },
- //鏄剧ず
- open(mode='add'){
- this.mode = mode;
- this.visible = true;
- return this
- },
- //鍔犺浇鏍戞暟鎹�
- async getGroup(){
- var res = await this.$API.system.role.list.get();
- this.groups = res.data.rows;
- },
- async getDept(){
- var res = await this.$API.system.dept.list.get();
- this.depts = res.data;
- },
- //琛ㄥ崟鎻愪氦鏂规硶
- saveSubmit(){
- var obj = Object.assign({},this.addPersonForm);
- obj.deptId = obj.deptId.join(",");
- obj.postId = obj.postId.join(",");
- this.$refs.dialogForm.validate(async (valid) => {
- if (valid) {
- this.$HTTP.post("/api/blade-cps/employee/submit",obj).then(res=> {
- if(res.code == 200) {
- this.$emit('success', this.addPersonForm, this.mode);
- this.visible = false;
- this.$message.success("鎿嶄綔鎴愬姛");
- }else {
- this.$alert(res.message, "鎻愮ず", {type: 'error'});
- }
- })
- }else{
- return false;
- }
- })
- },
- //琛ㄥ崟娉ㄥ叆鏁版嵁
- setData(data){
- this.$HTTP.get(`/api/blade-cps/employee/detail/${data.id}`).then(res=> {
- if(res.code == 200) {
- if(res.data.postId) {
- res.data.postId = res.data.postId.split(",");
- }else {
- res.data.postId = [];
- }
- if(res.data.deptId) {
- res.data.deptId = res.data.deptId.split(",");
- }else {
- res.data.deptId = [];
- }
- res.data.status = String(res.data.status);
- //鍙互鍜屼笂闈竴鏍峰崟涓敞鍏ワ紝涔熷彲浠ュ儚涓嬮潰涓�鏍风洿鎺ュ悎骞惰繘鍘�
- Object.assign(this.addPersonForm, res.data);
- }
- })
+ depts: [],
+ deptsProps: {
+ value: "id",
+ checkStrictly: true
}
}
+ },
+ mounted() {
+ this.getStatus();
+ this.getpost(); //宀椾綅
+ this.getOrganizationList(); //閮ㄩ棬
+ this.getUserId(); //鍏宠仈璐﹀彿
+ this.getdeptId(); //鏁版嵁鏉冮檺璋冩暣
+ },
+ methods: {
+ parentIdChange(val) {
+ // var $parentId = this.$refs.parentTree.getCurrentNode().title;
+ // this.depatmentForm.$parentId = $parentId;
+ },
+ getdeptId() { //鏁版嵁鏉冮檺璋冩暣
+ this.$HTTP.get(`/api/blade-system/data-scope-manager/tree`).then(res => {
+ if (res.code == 200) {
+ this.deptIdList = res.data;
+ }
+ })
+ },
+ getUserId() { //鍏宠仈璐﹀彿
+ this.$HTTP.get(`/api/blade-user/unbind-account?tel=`).then(res => {
+ if (res.code == 200) {
+ this.userIdList = res.data;
+ }
+ })
+ },
+ getOrganizationList() {
+ this.$HTTP.get(`/api/blade-cps/organization/tree?groupType=group_organization&groupCategory=1`).then(res => {
+ if (res.code == 200) {
+ this.departmentList = res.data;
+ this.addPersonForm.organizationId = res.data[0].id;
+ }
+ })
+ },
+ getpost() { //宀椾綅
+ this.$HTTP.get(`/api/blade-system/post/page?current=1&size=-1`).then(res => {
+ if (res.code == 200) {
+ this.postList = res.data.records;
+ }
+ })
+ },
+ getStatus() { //鑾峰彇鍏ㄩ儴璐﹀彿
+ this.$HTTP.get(`/api/blade-system/dict/dictionary?code=employee_status`).then(res => {
+ if (res.code == 200) {
+ this.statusList = res.data;
+ res.data.forEach(item => {
+ if (item.dictValue == "鍦ㄨ亴") {
+ this.addPersonForm.status = item.dictKey;
+ }
+ })
+ }
+ })
+ },
+ //鏄剧ず
+ open(mode = 'add') {
+ this.mode = mode;
+ this.visible = true;
+ return this
+ },
+ //鍔犺浇鏍戞暟鎹�
+ async getGroup() {
+ var res = await this.$API.system.role.list.get();
+ this.groups = res.data.rows;
+ },
+ async getDept() {
+ var res = await this.$API.system.dept.list.get();
+ this.depts = res.data;
+ },
+ //琛ㄥ崟鎻愪氦鏂规硶
+ saveSubmit() {
+ var obj = Object.assign({}, this.addPersonForm);
+ obj.deptId = obj.deptId.join(",");
+ obj.postId = obj.postId.join(",");
+ this.$refs.dialogForm.validate(async (valid) => {
+ if (valid) {
+ this.$HTTP.post("/api/blade-cps/employee/submit", obj).then(res => {
+ if (res.code == 200) {
+ this.$emit('success', this.addPersonForm, this.mode);
+ this.visible = false;
+ this.$message.success("鎿嶄綔鎴愬姛");
+ } else {
+ this.$alert(res.message, "鎻愮ず", { type: 'error' });
+ }
+ })
+ } else {
+ return false;
+ }
+ })
+ },
+ //琛ㄥ崟娉ㄥ叆鏁版嵁
+ setData(data) {
+ this.$HTTP.get(`/api/blade-cps/employee/detail/${data.id}`).then(res => {
+ if (res.code == 200) {
+ if (res.data.postId) {
+ res.data.postId = res.data.postId.split(",");
+ } else {
+ res.data.postId = [];
+ }
+ if (res.data.deptId) {
+ res.data.deptId = res.data.deptId.split(",");
+ } else {
+ res.data.deptId = [];
+ }
+ res.data.status = String(res.data.status);
+ //鍙互鍜屼笂闈竴鏍峰崟涓敞鍏ワ紝涔熷彲浠ュ儚涓嬮潰涓�鏍风洿鎺ュ悎骞惰繘鍘�
+ Object.assign(this.addPersonForm, res.data);
+ }
+ })
+ }
}
+}
</script>
-<style>
-</style>
+<style></style>
--
Gitblit v1.9.3