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