Commit 1ed98213 authored by renjintao's avatar renjintao

user

parent 488c9b1d
......@@ -2627,7 +2627,7 @@
},
"adler-32": {
"version": "1.2.0",
"resolved": "https://registry.npm.taobao.org/adler-32/download/adler-32-1.2.0.tgz",
"resolved": "https://registry.npmjs.org/adler-32/-/adler-32-1.2.0.tgz",
"integrity": "sha1-aj5r8KY5ALoVZSgIyxXGgT0aXyU=",
"requires": {
"exit-on-epipe": "~1.0.1",
......@@ -4774,7 +4774,7 @@
},
"codepage": {
"version": "1.14.0",
"resolved": "https://registry.npm.taobao.org/codepage/download/codepage-1.14.0.tgz",
"resolved": "https://registry.npmjs.org/codepage/-/codepage-1.14.0.tgz",
"integrity": "sha1-jL4lSBMjVZ19MHVxsP/5HnodL5k=",
"requires": {
"commander": "~2.14.1",
......@@ -6226,7 +6226,7 @@
},
"echarts": {
"version": "4.8.0",
"resolved": "https://registry.npm.taobao.org/echarts/download/echarts-4.8.0.tgz?cache=0&sync_timestamp=1596215792462&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fecharts%2Fdownload%2Fecharts-4.8.0.tgz",
"resolved": "https://registry.npm.taobao.org/echarts/download/echarts-4.8.0.tgz",
"integrity": "sha1-ssHPuSKbE9No7hBPyO6mALV01MQ=",
"requires": {
"zrender": "4.3.1"
......@@ -20598,7 +20598,7 @@
},
"zrender": {
"version": "4.3.1",
"resolved": "https://registry.npm.taobao.org/zrender/download/zrender-4.3.1.tgz?cache=0&sync_timestamp=1596718989769&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fzrender%2Fdownload%2Fzrender-4.3.1.tgz",
"resolved": "https://registry.npm.taobao.org/zrender/download/zrender-4.3.1.tgz?cache=0&sync_timestamp=1597683748542&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fzrender%2Fdownload%2Fzrender-4.3.1.tgz",
"integrity": "sha1-uviqbcgYei+BlpLX1fm+36K5D6M="
}
}
......
<template>
<Layout class="full">
<Sider
hide-trigger
:style="{background: '#fff'}"
width="260"
class="menu"
style=" flex:0;border:none"
>
<Layout class="full">
<Sider hide-trigger :style="{background: '#fff'}" width="260" class="menu" style=" flex:0;border:none">
<div class="zh-tree" :style="{height:treeHeight+'px'}">
<h3 class="zh-title">部门结构</h3>
<div class="zh-box">
......@@ -16,15 +10,7 @@
</div>
</Sider>
<Content class="content">
<DataGrid
:columns="columns"
ref="grid"
:action="action"
:conditions="easySearch"
placeholder="请输入姓名/员工编号"
:high="true"
:height="tdHeight"
>
<DataGrid :columns="columns" ref="grid" :action="action" :conditions="easySearch" placeholder="请输入姓名/员工编号" :high="true" :height="tdHeight">
<template slot="searchForm">
<Search />
</template>
......@@ -47,25 +33,9 @@
<p>确定删除?</p>
</Modal>
<!-- 重置密码 -->
<Modal
v-model="show7"
title="提示"
:mask-closable="false"
ok-text="确定"
cancel-text="取消"
@on-ok="reset"
>此操作将密码重置为初始密码, 是否继续?</Modal>
<Modal v-model="show7" title="提示" :mask-closable="false" ok-text="确定" cancel-text="取消" @on-ok="reset">此操作将密码重置为初始密码, 是否继续?</Modal>
<!-- 授权 -->
<Modal
v-model="show3"
title="授权-当前用户"
:width="800"
:mask-closable="false"
ok-text="保存"
cancel-text="取消"
@on-ok="authOk"
@on-cancel="authCancle"
>
<Modal v-model="show3" title="授权-当前用户" :width="800" :mask-closable="false" ok-text="保存" cancel-text="取消" @on-ok="authOk" @on-cancel="authCancle">
<div style="max-height:400px;overflow:auto">
<Form :model="authModel" :label-width="70">
<Row>
......@@ -76,13 +46,7 @@
<div style="width:750px;border:2px solid #E8EAEC;margin-top:10px">
<Row>
<CheckboxGroup v-model="authModel.default">
<Col
span="5"
offset="1"
v-for="(item,index) in authList1"
:key="index"
style="line-height:33px;font-size:14px;"
>
<Col span="5" offset="1" v-for="(item,index) in authList1" :key="index" style="line-height:33px;font-size:14px;">
<Checkbox :label="item.id">{{item.name}}</Checkbox>
</Col>
</CheckboxGroup>
......@@ -97,13 +61,7 @@
<div style="width:750px;border:2px solid #E8EAEC;margin-top:10px">
<Row>
<CheckboxGroup v-model="authModel.extra">
<Col
span="5"
offset="1"
v-for="(item,index) in authList"
:key="index"
style="line-height:33px;font-size:14px;"
>
<Col span="5" offset="1" v-for="(item,index) in authList" :key="index" style="line-height:33px;font-size:14px;">
<Checkbox :label="item.id">{{item.name}}</Checkbox>
</Col>
</CheckboxGroup>
......@@ -122,15 +80,7 @@
<Upload action :before-upload="beforeUpload" ref="uploadfile" :format="formatList">
<Button icon="ios-cloud-upload-outline">上传Excel文件</Button>
</Upload>
<DataGrid
border
:height="tdHeightExcel"
:columns="columnsImport"
:data="excelData"
:tool="false"
:page="false"
:set="false"
></DataGrid>
<DataGrid border :height="tdHeightExcel" :columns="columnsImport" :data="excelData" :tool="false" :page="false" :set="false"></DataGrid>
<div slot="footer">
<span v-if="excelData.length>0">共 {{excelData.length}} 条数据</span>
<Button @click="cancelExcel">取消</Button>
......@@ -138,8 +88,9 @@
</div>
</Modal>
</Content>
</Layout>
</Layout>
</template>
<script>
import Api from "./api";
import ApiDepart from "../department/api";
......@@ -149,7 +100,9 @@ import Detail from "./detail";
import Search from "./search";
import service from "@/plugins/request";
import util from "@/libs/util";
import { Time } from "view-design";
import {
Time
} from "view-design";
import XLSX from "xlsx";
export default {
......@@ -165,12 +118,14 @@ export default {
action: Api.index,
easySearch: {
keys: {
op:
"userName,cardNo,national,phone,email,enableEquip,jobNo,remark,departmentTitle,roleTitles",
op: "userName,cardNo,national,phone,email,enableEquip,jobNo,remark,departmentTitle,roleTitles",
value: null,
default: true,
},
departmentId: { op: "In", value: "" },
departmentId: {
op: "In",
value: ""
},
},
treeData: [],
tdHeight: "",
......@@ -182,7 +137,10 @@ export default {
show3: false, //授权角色
authList: [],
authList1: [],
authModel: { default: [], extra: [] },
authModel: {
default: [],
extra: []
},
ids: [],
addModal: false,
editModal: false,
......@@ -197,7 +155,12 @@ export default {
// width: 80,
// align: 'center'
// },
{ key: "id", title: this.l("id"), hide: true, align: "left" },
{
key: "id",
title: this.l("id"),
hide: true,
align: "left"
},
{
key: "userName",
title: this.l("userName"),
......@@ -205,12 +168,17 @@ export default {
easy: true,
high: true,
render: (h, params) => {
return h("div", { class: "action" }, [
return h("div", {
class: "action"
}, [
h(
"op",
{
attrs: { oprate: "detail" },
on: { click: () => this.detail(params.row.id) },
"op", {
attrs: {
oprate: "detail"
},
on: {
click: () => this.detail(params.row.id)
},
},
params.row.userName
),
......@@ -282,23 +250,24 @@ export default {
high: true,
hide: true,
render: (h, params) => {
return h("div", { class: "action" }, [
return h("div", {
class: "action"
}, [
h(
"op",
{
"op", {
attrs: {
oprate: "detail",
class:
params.row.roleTitles == null ||
params.row.roleTitles == ""
? "empower"
: "detail",
class: params.row.roleTitles == null ||
params.row.roleTitles == "" ?
"empower" : "detail",
},
on: {
click: () => this.authorize(params.row.id)
},
on: { click: () => this.authorize(params.row.id) },
},
params.row.roleTitles == null || params.row.roleTitles == ""
? "授权"
: params.row.roleTitles
params.row.roleTitles == null || params.row.roleTitles == "" ?
"授权" :
params.row.roleTitles
),
]);
},
......@@ -383,41 +352,51 @@ export default {
align: "right",
import: false,
render: (h, params) => {
return h("div", { class: "action" }, [
return h("div", {
class: "action"
}, [
h(
"op",
{
"op", {
attrs: {
oprate: "detail",
class: "empower",
},
on: { click: () => this.syncAccount(params.row) },
on: {
click: () => this.syncAccount(params.row)
},
},
params.row.accountId == 0 ? "同步" : ""
),
h(
"op",
{
attrs: { oprate: "edit" },
on: { click: () => this.edit(params.row.id) },
"op", {
attrs: {
oprate: "edit"
},
on: {
click: () => this.edit(params.row.id)
},
},
"编辑"
),
h(
"op",
{
attrs: { oprate: "remove" },
on: { click: () => this.remove(params.row) },
"op", {
attrs: {
oprate: "remove"
},
on: {
click: () => this.remove(params.row)
},
},
"删除"
),
h(
"op",
{
"op", {
attrs: {
oprate: "detail",
},
on: { click: () => this.openReset(params.row) },
on: {
click: () => this.openReset(params.row)
},
},
"重置密码"
),
......@@ -470,7 +449,10 @@ export default {
this.loadrole(0);
this.loadrole(1);
},
async fetch({ store, params }) {
async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
......@@ -501,7 +483,9 @@ export default {
this.selectRow = row;
},
removeOk() {
Api.delete({ id: this.curId }).then((r) => {
Api.delete({
id: this.curId
}).then((r) => {
if (r.success) {
this.$refs.grid.load();
this.deletelModal = false;
......@@ -510,7 +494,7 @@ export default {
let parms = {
userId: this.curId,
accountId: this.selectRow.accountId,
tanantCode: util.cookies.get("tanantCode"),
tenantCode: util.cookies.get("tanantCode"),
isDeleted: true,
name: this.selectRow.userName,
};
......@@ -596,7 +580,9 @@ export default {
loadrole(type) {
var url = `${systemUrl}/MyRole/GetRolesAsync`;
var data = [];
service.get(`${url}`, { role_type: type }).then((response) => {
service.get(`${url}`, {
role_type: type
}).then((response) => {
data = response.result.items;
if (type == 1) {
this.authList = data;
......@@ -613,7 +599,9 @@ export default {
this.curId = id;
this.show3 = true;
var url = `${systemUrl}/MyUserRole/GetPaged`;
service.get(`${url}`, { userId: id }).then((response) => {
service.get(`${url}`, {
userId: id
}).then((response) => {
var data = response.result.items;
var dt1 = data.filter(function (ite) {
return ite.role_type == 0;
......@@ -661,7 +649,7 @@ export default {
userId: this.selectRow.id,
loginName: this.selectRow.phone,
status: this.selectRow.status,
tanantCode: util.cookies.get("tanantCode"),
tenantCode: util.cookies.get("tanantCode"),
name: this.selectRow.userName,
};
if (this.selectRow.phone && this.selectRow.phone != "") {
......@@ -734,7 +722,10 @@ export default {
//tHeader.push(el.key + "DirName");
//filterVal.push(el.key + "DirName");
//tempCol.push({ key: el.key + "DirName", code: el.code }); //临时存放code数据字典的字段及对应的数据字典code
tempCol.push({ key: el.key, code: el.code }); //临时存放code数据字典的字段及对应的数据字典code
tempCol.push({
key: el.key,
code: el.code
}); //临时存放code数据字典的字段及对应的数据字典code
}
tHeader.push(this.l(el.key));
filterVal.push(el.key);
......@@ -810,7 +801,10 @@ export default {
var arrTitleUse = []; //使用数据字典的字段
tempColums.forEach((elCode) => {
if (elCode.code) {
arrTitleUse.push({ key: elCode.key, code: elCode.code });
arrTitleUse.push({
key: elCode.key,
code: elCode.code
});
}
});
......@@ -914,7 +908,10 @@ export default {
var arrTitleUse = []; //使用数据字典的字段
tempColums.forEach((elCode) => {
if (elCode.code) {
arrTitleUse.push({ key: elCode.key, code: elCode.code });
arrTitleUse.push({
key: elCode.key,
code: elCode.code
});
}
});
......@@ -965,6 +962,7 @@ export default {
let nodeList = this.treeData;
var text = this.treeInputSearch;
var newNodeList = [];
function searchTree(nodeLists, value) {
for (let i = 0; i < nodeLists.length; i++) {
if (nodeLists[i].title.indexOf(value) != -1) {
......@@ -987,9 +985,11 @@ export default {
},
};
</script>
<style lang="less" scoped>
.full {
margin-top: 0;
.content {
margin-top: 10px;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment