Commit 70d317c7 authored by 仇晓婷's avatar 仇晓婷

Merge branch 'portal' of http://git.mes123.com/zhouyx/mes-ui into portal

parents 9e11f776 d6a25252
...@@ -711,7 +711,7 @@ textarea::-webkit-input-placeholder { ...@@ -711,7 +711,7 @@ textarea::-webkit-input-placeholder {
background: #fff; background: #fff;
padding: 0px 10px 20px 10px; padding: 0px 10px 20px 10px;
margin-top: 10px; margin-top: 10px;
overflow: auto;
.zh-title { .zh-title {
font-size: 14px; font-size: 14px;
padding: 0 5px; padding: 0 5px;
...@@ -1156,7 +1156,7 @@ html [type=button] { ...@@ -1156,7 +1156,7 @@ html [type=button] {
} }
} }
.tree { .tree {
height: calc(100% - 150px); // height: calc(100% - 150px);
overflow: auto; overflow: auto;
} }
} }
...@@ -1190,4 +1190,10 @@ html [type=button] { ...@@ -1190,4 +1190,10 @@ html [type=button] {
.content { .content {
padding-left: 5px; padding-left: 5px;
} }
// 详情弹框css
.row_border_bottom{
border-bottom: 1px solid #E0E0E0;
padding: 15px 20px;
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
<template> <template>
<div class="detail"> <div >
<Row> <!-- <Row> class="detail"
<Filed :span="12" :name="l('businessName')">{{entity.businessName}}</Filed> <Filed :span="12" :name="l('businessName')">{{entity.businessName}}</Filed>
<Filed :span="12" :name="l('businessCode')">{{entity.businessCode}}</Filed> <Filed :span="12" :name="l('businessCode')">{{entity.businessCode}}</Filed>
<Filed :span="12" :name="l('prefix')">{{entity.prefix}}</Filed> <Filed :span="12" :name="l('prefix')">{{entity.prefix}}</Filed>
...@@ -10,6 +10,36 @@ ...@@ -10,6 +10,36 @@
</Filed> </Filed>
<Filed :span="12"></Filed> <Filed :span="12"></Filed>
<Filed :span="24" :name="l('remark')">{{entity.remark}}</Filed> <Filed :span="24" :name="l('remark')">{{entity.remark}}</Filed>
</Row> -->
<Row class="row_border_bottom">
<Col :span="8">
<b>{{l('businessName')}}</b>
<p>{{entity.businessName}}</p>
</Col>
<Col :span="8">
<b>{{l('businessCode')}}</b>
<p>{{entity.businessCode}}</p>
</Col>
<Col :span="8">
<b>{{l('prefix')}}</b>
<p>{{entity.prefix}}</p>
</Col>
</Row>
<Row class="row_border_bottom">
<Col :span="8">
<b>{{l('maxSerial')}}</b>
<p>{{entity.maxSerial}}</p>
</Col>
<Col :span="8">
<b>{{l('day')}}</b>
<p><state code="mes_xingchi_system.business_code_config.day" :value="entity.day" /></p>
</Col>
</Row>
<Row class="row_border_bottom">
<Col :span="24">
<b>{{l('remark')}}</b>
<p>{{entity.remark}}</p>
</Col>
</Row> </Row>
</div> </div>
</template> </template>
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<Modal v-model="setModal" title="设置" width="600" footer-hide> <Modal v-model="setModal" title="设置" width="600" footer-hide>
<Set :eid="curId" @on-close="cancel" @on-ok="addOk" /> <Set :eid="curId" @on-close="cancel" @on-ok="addOk" />
</Modal> </Modal>
<Modal v-model="detailModal" title="详情" width="800"> <Modal v-model="detailModal" title="详情" width="900">
<Detail :eid="curId" /> <Detail :eid="curId" />
</Modal> </Modal>
</div> </div>
......
<template> <template>
<Layout class="full"> <Layout class="full">
<Sider hide-trigger :style="{background: '#fff'}" class="menu" width="240" > <Sider hide-trigger :style="{background: '#fff'}" class="menu" width="240">
<h3 class="title"> <h3 class="title">
数据字典 数据字典
<ButtonGroup class="fr" size="small"> <ButtonGroup class="fr" size="small">
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
</Button> </Button>
</ButtonGroup> </ButtonGroup>
</h3> </h3>
<div class="tree"> <div class="tree" :style="{height:treeHeight+'px'}">
<Tree :data="tree" @on-select-change="change" /> <Tree :data="tree" @on-select-change="change" />
</div> </div>
</Sider> </Sider>
...@@ -79,12 +79,8 @@ ...@@ -79,12 +79,8 @@
</template> </template>
<template slot-scope="{ row, index }" slot="icon"> <template slot-scope="{ row, index }" slot="icon">
<div v-if="row.icon"> <div v-if="row.icon">
<Icon <Icon :type="row.icon" @on-change="setColor($event,row,index)" />
:type="row.icon"
@on-change="setColor($event,row,index)"
/>
</div> </div>
</template> </template>
<template slot-scope="{ row, index }" slot="code"> <template slot-scope="{ row, index }" slot="code">
<span v-if="edit!=index" v-text="row.code"></span> <span v-if="edit!=index" v-text="row.code"></span>
...@@ -111,151 +107,164 @@ ...@@ -111,151 +107,164 @@
</Layout> </Layout>
</template> </template>
<script> <script>
import Edit from './components/edit' import Edit from "./components/edit";
import api from './api.js' import api from "./api.js";
import Clipboard from 'clipboard' import Clipboard from "clipboard";
const root = { const root = {
id: 0, id: 0,
typeId: -1, typeId: -1,
title: '顶级节点', title: "顶级节点",
code: '' code: ""
} };
export default { export default {
data() { data() {
return { return {
code: '2', treeHeight: "",
code: "2",
expand: false, expand: false,
editModal: false, editModal: false,
editModel: { editModel: {
color: '' color: ""
}, },
editTitle: '编辑', editTitle: "编辑",
node: root, node: root,
color4: '', color4: "",
cur: null, cur: null,
names: [root.title], names: [root.title],
types: ['系统', '分类', '字典', '字典项'], types: ["系统", "分类", "字典", "字典项"],
addName: '添加', addName: "添加",
tree: [], tree: [],
edit: -1, edit: -1,
data: [], data: [],
columns: [ columns: [
{ {
type: 'index', type: "index",
width: 60, width: 60,
align: 'center' align: "center"
}, },
{ {
title: '类别', title: "类别",
key: 'typeId', key: "typeId",
width: 100, width: 100,
align: 'center', align: "center",
slot: 'typeId' slot: "typeId"
}, },
{ {
title: '颜色', title: "颜色",
key: 'color', key: "color",
width: 100, width: 100,
align: 'center', align: "center",
slot: 'color' slot: "color"
}, },
{ {
title: '名称', title: "名称",
key: 'name', key: "name",
width: 150, width: 150,
slot: 'name' slot: "name"
}, },
{ {
title: '编码', title: "编码",
key: 'code', key: "code",
slot: 'code' slot: "code"
}, },
{ {
title: '图标', title: "图标",
key: 'icon', key: "icon",
slot: 'icon' slot: "icon"
}, },
{ {
title: '描述', title: "描述",
key: 'description' key: "description"
}, },
{ {
title: '状态', title: "状态",
key: 'status', key: "status",
width: 100, width: 100,
align: 'center', align: "center",
slot: 'status' slot: "status"
}, },
{ {
title: '锁定', title: "锁定",
key: 'isStatic', key: "isStatic",
width: 100, width: 100,
align: 'center', align: "center",
slot: 'isStatic' slot: "isStatic"
}, },
{ {
title: '操作', title: "操作",
key: 'action', key: "action",
width: 160, width: 160,
align: 'center', align: "center",
slot: 'action' slot: "action"
} }
] ]
} };
}, },
components: { Edit }, components: { Edit },
async fetch({ store, params }) { async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
created() { created() {
this.load() this.load();
this.loadTree() this.loadTree();
this.treeHeight = window.innerHeight - 180
},
mounted() {
window.onresize = () => {
///浏览器窗口大小变化
return (() => {
window.screenHeight = window.innerHeight
this.treeHeight = window.screenHeight - 180
})();
}
this.load();
this.loadTree();
}, },
methods: { methods: {
copy() { copy() {
var clipboard = new Clipboard('.tag-read') var clipboard = new Clipboard(".tag-read");
clipboard.on('success', (e) => { clipboard.on("success", e => {
this.$Message.success('复制成功:' + this.node.code) this.$Message.success("复制成功:" + this.node.code);
clipboard.destroy() clipboard.destroy();
}) });
clipboard.on('error', (e) => { clipboard.on("error", e => {
// 不支持复制 // 不支持复制
console.log('该浏览器不支持自动复制') // 释放内存 console.log("该浏览器不支持自动复制"); // 释放内存
clipboard.destroy() clipboard.destroy();
}) });
}, },
editRow(row, index) { editRow(row, index) {
this.editTitle = '编辑' this.editTitle = "编辑";
this.editModal = true this.editModal = true;
this.editModel = row this.editModel = row;
}, },
toggle() { toggle() {
this.expand = !this.expand this.expand = !this.expand;
this.loadTree() this.loadTree();
}, },
editOk() { editOk() {
this.load() this.load();
this.editModal = false this.editModal = false;
}, },
delRow(row, index) { delRow(row, index) {
var url = `${systemUrl}/Dictionary/Delete?id=${row.id}` var url = `${systemUrl}/Dictionary/Delete?id=${row.id}`;
this.$Modal.confirm({ this.$Modal.confirm({
title: '操作确认', title: "操作确认",
content: '确定要删除吗?', content: "确定要删除吗?",
onOk: () => { onOk: () => {
this.$api this.$api
.delete(`${url}`) .delete(`${url}`)
.then((r) => { .then(r => {
if (r.success) { if (r.success) {
this.$Message.success('删除成功') this.$Message.success("删除成功");
this.load() this.load();
} }
}) })
.catch((error) => { .catch(error => {
this.$Message.error('删除失败') this.$Message.error("删除失败");
}) });
} }
}) });
}, },
change(nodes, node) { change(nodes, node) {
// console.warn(node,nodes) // console.warn(node,nodes)
...@@ -264,108 +273,108 @@ export default { ...@@ -264,108 +273,108 @@ export default {
typeId: node.data.typeId, typeId: node.data.typeId,
title: node.title, title: node.title,
code: node.data.code code: node.data.code
} };
// this.names = [node.title] // this.names = [node.title]
let cur = node let cur = node;
let titles = [] let titles = [];
while (cur) { while (cur) {
titles.push(cur.title) titles.push(cur.title);
cur = cur.parent cur = cur.parent;
} }
this.names = titles.reverse() this.names = titles.reverse();
this.load(node.id) this.load(node.id);
}, },
setRoot() { setRoot() {
this.load(0) this.load(0);
this.loadTree() this.loadTree();
this.node = root this.node = root;
}, },
async setColor(v, row, i) { async setColor(v, row, i) {
let r = await api.setColor({ id: row.id, color: v }) let r = await api.setColor({ id: row.id, color: v });
if (r.success) { if (r.success) {
this.$Message.success('颜色设置成功!') this.$Message.success("颜色设置成功!");
row.color = v row.color = v;
} else { } else {
this.$Message.error('颜色设置失败!') this.$Message.error("颜色设置失败!");
row.color = '' row.color = "";
} }
}, },
async load() { async load() {
this.edit = -1 this.edit = -1;
let r = await api.getChildren(this.node.id) let r = await api.getChildren(this.node.id);
this.data = r.result this.data = r.result;
}, },
async loadTree() { async loadTree() {
let r = await api.getTree(this.node.id) let r = await api.getTree(this.node.id);
if (r.success) { if (r.success) {
let items = r.result let items = r.result;
var expand = this.expand var expand = this.expand;
setParent(null, items) setParent(null, items);
function setParent(parent, items) { function setParent(parent, items) {
items.map((u) => { items.map(u => {
u.parent = parent u.parent = parent;
u.expand = expand u.expand = expand;
if (u.children) { if (u.children) {
setParent(u, u.children) setParent(u, u.children);
} }
}) });
} }
this.tree = items this.tree = items;
} }
}, },
onDragDrop(a, b) { onDragDrop(a, b) {
this.data.splice(b, 1, ...this.data.splice(a, 1, this.data[b])) this.data.splice(b, 1, ...this.data.splice(a, 1, this.data[b]));
let ids = [] let ids = [];
this.data.map((u) => { this.data.map(u => {
ids.push(u.id) ids.push(u.id);
}) });
if (ids.length > 1) { if (ids.length > 1) {
api.setSort({ ids }).then((r) => { api.setSort({ ids }).then(r => {
if (!r.success) { if (!r.success) {
this.$Message.error('排序失败') this.$Message.error("排序失败");
this.load() this.load();
} }
}) });
} }
}, },
addNew() { addNew() {
this.edit = this.data.length this.edit = this.data.length;
this.cur = { this.cur = {
upId: this.node.id, upId: this.node.id,
name: '', name: "",
code: '', code: "",
color: '', color: "",
status: 0, status: 0,
isStatic: 0, isStatic: 0,
typeId: this.node.typeId + 1, typeId: this.node.typeId + 1,
priority: this.edit priority: this.edit
} };
this.data.push(this.cur) this.data.push(this.cur);
}, },
remove() { remove() {
this.edit = -1 this.edit = -1;
// this.load(this.node.id) // this.load(this.node.id)
this.data.pop() this.data.pop();
}, },
save() { save() {
if (this.cur.name == '') { if (this.cur.name == "") {
this.$Message.error('名称不能为空') this.$Message.error("名称不能为空");
return return;
} }
if (this.cur.code == '') { if (this.cur.code == "") {
this.$Message.error('值不能为空') this.$Message.error("值不能为空");
return return;
} }
api.save(this.cur).then((r) => { api.save(this.cur).then(r => {
console.warn(r) console.warn(r);
if (r.success) { if (r.success) {
this.$Message.success('添加成功') this.$Message.success("添加成功");
this.load() this.load();
} }
}) });
} }
} }
} };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.full { .full {
......
<template> <template>
<div class="addUser"> <div class="addUser">
<Form ref="form" :model="entity" :label-width="90"> <Form ref="form" :model="entity" :label-width="90">
<Row> <Row class="row_border_bottom">
<Col :span="12"> <Col :span="8">
<FormItem :label="l('userName')" prop="userName">{{entity.userName}}</FormItem> <!-- <FormItem :label="l('userName')" prop="userName">{{entity.userName}}</FormItem> -->
<b>{{l('userName')}}</b>
<p>{{entity.userName}}</p>
</Col> </Col>
<Col :span="12"> <Col :span="8">
<FormItem :label="l('cardNo')" prop="cardNo">{{entity.cardNo}}</FormItem> <!-- <FormItem :label="l('cardNo')" prop="cardNo">{{entity.cardNo}}</FormItem> -->
<b>{{l('cardNo')}}</b>
<p>{{entity.cardNo}}</p>
</Col> </Col>
<Col :span="12"> <Col :span="8">
<FormItem :label="l('gender')" prop="gender"> <!-- <FormItem :label="l('gender')" prop="gender">
<state code="User.base.gender" :value="entity.gender" type="text"></state> <state code="User.base.gender" :value="entity.gender" type="text"></state>
</FormItem> </FormItem> -->
<b>{{l('gender')}}</b>
<p><state code="User.base.gender" :value="entity.gender" type="text"></state></p>
</Col> </Col>
<Col :span="12"> </Row>
<FormItem :label="l('birthday')" prop="birthday">{{entity.birthday}}</FormItem> <Row class="row_border_bottom">
<Col :span="8">
<!-- <FormItem :label="l('birthday')" prop="birthday">{{entity.birthday}}</FormItem> -->
<b>{{l('birthday')}}</b>
<p>{{entity.birthday}}</p>
</Col> </Col>
<Col :span="12"> <Col :span="8">
<FormItem :label="l('degreeId')" prop="degreeId"> <!-- <FormItem :label="l('degreeId')" prop="degreeId">
<state code="User.base.degree" :value="entity.degreeId" type="text"></state> <state code="User.base.degree" :value="entity.degreeId" type="text"></state>
</FormItem> </FormItem> -->
<b>{{l('degreeId')}}</b>
<p><state code="User.base.degree" :value="entity.degreeId" type="text"></state></p>
</Col> </Col>
<Col :span="12"> <Col :span="8">
<FormItem :label="l('departmentTitle')" prop="departmentTitle">{{entity.departmentTitle}}</FormItem> <!-- <FormItem :label="l('departmentTitle')" prop="departmentTitle">{{entity.departmentTitle}}</FormItem> -->
<b>{{l('departmentTitle')}}</b>
<p>{{entity.departmentTitle}}</p>
</Col> </Col>
<Col :span="12"> </Row>
<FormItem :label="l('status')" prop="status"> <Row class="row_border_bottom">
<Col :span="8">
<!-- <FormItem :label="l('status')" prop="status">
<state code="User.base.status" :value="entity.status" type="text"></state> <state code="User.base.status" :value="entity.status" type="text"></state>
</FormItem> </FormItem> -->
<b>{{l('status')}}</b>
<p><state code="User.base.status" :value="entity.status" type="text"></state></p>
</Col> </Col>
<Col :span="12"> <Col :span="8">
<FormItem :label="l('phone')" prop="phone">{{entity.phone}}</FormItem> <!-- <FormItem :label="l('phone')" prop="phone">{{entity.phone}}</FormItem> -->
<b>{{l('phone')}}</b>
<p>{{entity.phone}}</p>
</Col> </Col>
<Col :span="12"> <Col :span="8">
<FormItem :label="l('email')" prop="email">{{entity.email}}</FormItem> <!-- <FormItem :label="l('email')" prop="email">{{entity.email}}</FormItem> -->
<b>{{l('email')}}</b>
<p>{{entity.email}}</p>
</Col> </Col>
<!-- <Col :span="12"> <!-- <Col :span="12">
<FormItem :label="l('enableEquip')" prop="enableEquip">{{entity.enableEquip}}</FormItem> <FormItem :label="l('enableEquip')" prop="enableEquip">{{entity.enableEquip}}</FormItem>
</Col> --> </Col> -->
<Col :span="12"> </Row>
<FormItem :label="l('positionId')" prop="positionId"> <Row class="row_border_bottom">
<Col :span="8">
<!-- <FormItem :label="l('positionId')" prop="positionId">
<state code="User.base.position" :value="entity.positionId" type="text"></state> <state code="User.base.position" :value="entity.positionId" type="text"></state>
</FormItem> </FormItem> -->
<b>{{l('positionId')}}</b>
<p><state code="User.base.position" :value="entity.positionId" type="text"></state></p>
</Col> </Col>
<Col :span="12"> <Col :span="8">
<FormItem :label="l('titleId')" prop="titleId"> <!-- <FormItem :label="l('titleId')" prop="titleId">
<state code="User.base.jobtitle" :value="entity.titleId" type="text"></state> <state code="User.base.jobtitle" :value="entity.titleId" type="text"></state>
</FormItem> </FormItem> -->
<b>{{l('titleId')}}</b>
<p><state code="User.base.titleId" :value="entity.titleId" type="text"></state></p>
</Col> </Col>
<Col :span="12"> <Col :span="8">
<FormItem :label="l('licensedToWork')" prop="licensedToWork"> <!-- <FormItem :label="l('licensedToWork')" prop="licensedToWork">
<state code="User.base.workLicense" :value="entity.licensedToWork" type="text"></state> <state code="User.base.workLicense" :value="entity.licensedToWork" type="text"></state>
</FormItem> </FormItem> -->
<b>{{l('workLicense')}}</b>
<p><state code="User.base.workLicense" :value="entity.workLicense" type="text"></state></p>
</Col> </Col>
</Row>
<Row class="row_border_bottom">
<Col :span="24"> <Col :span="24">
<FormItem :label="l('remark')" prop="remark">{{entity.remark}}</FormItem> <!-- <FormItem :label="l('remark')" prop="remark">{{entity.remark}}</FormItem> -->
<b>{{l('remark')}}</b>
<p>{{entity.remark}}</p>
</Col> </Col>
</Row> </Row>
</Form> </Form>
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<Modal v-model="editModal" title="编辑" footer-hide width="800"> <Modal v-model="editModal" title="编辑" footer-hide width="800">
<Edit :eid="curId" @on-close="cancel" @on-ok="addOk" /> <Edit :eid="curId" @on-close="cancel" @on-ok="addOk" />
</Modal> </Modal>
<Modal v-model="detailModal" title="详情" width="800"> <Modal v-model="detailModal" title="详情" width="900">
<Detail :eid="curId" /> <Detail :eid="curId" />
</Modal> </Modal>
<Modal v-model="deletelModal" title="删除" @on-ok="removeOk" @on-cancel="cancel"> <Modal v-model="deletelModal" title="删除" @on-ok="removeOk" @on-cancel="cancel">
......
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