Commit 50175133 authored by 骆瑛's avatar 骆瑛

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

parents 8940cc3a 255462d1
......@@ -285,6 +285,13 @@ html body {
.pl20 {
padding-left: 20px
}
.pr10 {
padding-right: 10px
}
.pr20 {
padding-right: 20px
}
.bnone {
border: none;
......@@ -698,7 +705,18 @@ i.icon-gengxin {
.tc {
text-align: center;
}
.lt30
{
line-height: 30px;
}
.lt40
{
line-height: 40px;
}
.lt50
{
line-height: 50px;
}
/*清除浮动*/
......
......@@ -102,6 +102,7 @@ export default {
treeData: [], //物料数据
codeRuleData: [], //物料编码
routingHeaderData: [], //工艺规程
allUser: []
};
},
props: {
......@@ -277,6 +278,7 @@ export default {
//this.getTreeData();
//this.getcodeRuleData();
//this.getRoutingHeaderData();
this.getAllUser()
},
methods: {
//数据加载
......@@ -477,6 +479,36 @@ export default {
this.footerToolbar = false;
this.$refs.table.selectAll(false);
},
//获取所有用户信息
getAllUser() {
this.$api.post(`${systemUrl}/user/paged`, {
conditions: [],
pageIndex: 1,
pageSize: 100000,
})
.then((r) => {
if (r.success) {
let tempUserInfo = r.result.items
tempUserInfo.forEach(ele => {
let temObj = {
userId: ele.id,
name: ele.userName
}
this.allUser.push(temObj)
})
}
})
},
getUserName(id) {
let name = ''
this.allUser.forEach(ele => {
if (id == ele.userId) {
name = ele.name
}
})
return name
},
//导出excel
export2Excel() {
......@@ -516,10 +548,13 @@ export default {
};
this.$api.post(this.action, searchs).then((r) => {
let list = [];
list = r.result.items;
if (r.success) {
list = r.result.items || [];
}
const tHeader = []; // 设置Excel的表格第一行的标题
const filterVal = []; //list里对象的属性
var tempCol = [];
var tempColUser = [];
var columnsCur = this.$u.clone(this.columnsCur); //导出列标题信息griddata this.$refs.grid.columnsCur
columnsCur.forEach((el) => {
if (
......@@ -535,19 +570,64 @@ export default {
code: el.code,
}); //临时存放code数据字典的字段及对应的数据字典code
}
if (el.type && el.type == "user") {
tempColUser.push({
key: el.key,
code: el.type,
}); //临时存放user列
}
tHeader.push(el.title);
filterVal.push(el.key);
}
});
list.forEach((e) => {
//给导出数据增加数据字典对应的name
tempCol.forEach((ele) => {
e[ele.key] = this.$u.dirName(
this.$store.getters.dictionaryByKey(ele.code),
e[ele.key]
);
// tempCol.forEach((ele) => {
// e[ele.key] = this.$u.dirName(
// this.$store.getters.dictionaryByKey(ele.code),
// e[ele.key]
// );
// });
tempCol.forEach((elem) => {
if (
e[elem.key] &&
e[elem.key] != "" &&
e[elem.key] != null
) {
//如果数据字典项对应的DirName字段存在,通过name查询到对应的code,然后赋值。
let codeArr = []
let keyValue = e[elem.key]
if (keyValue.length > 0 && (keyValue.indexOf(',') > -1 || keyValue.indexOf(',') > -1)) { //如果对应的数据包含多个数据字典项,比如包含“,”或“,”
if (keyValue.indexOf(',') > -1) {
codeArr = keyValue.split(',')
}
if (keyValue.indexOf > -1) {
codeArr = keyValue.split(',')
}
}
if (codeArr.length <= 1) { //对应的数据包含一个数据字典项
e[elem.key] = this.$u.dirName(
this.$store.getters.dictionaryByKey(elem.code),
e[elem.key]
);
} else { //对应的数据包含多个数据字典项
let codeInfo = ''
codeArr.forEach(el => {
codeInfo = codeInfo + this.$u.dirName(this.$store.getters.dictionaryByKey(elem.code), el) + ",";
})
e[elem.key] = codeInfo.substr(0, codeInfo.length - 1)
}
}
});
tempColUser.forEach(eluser => {
if (
e[eluser.key] &&
e[eluser.key] != "" &&
e[eluser.key] != null
) {
e[eluser.key] = this.getUserName(e[eluser.key])
}
})
});
let nowDate = this.$u.getNowTime(); //年月日时分秒yyyyMMddhhmmss
......@@ -560,7 +640,6 @@ export default {
);
});
},
},
computed: {
columnsNow() {
......
......@@ -251,12 +251,34 @@ export default {
}
arrTitleUse.forEach((elem) => {
if (eles[elem.key] && eles[elem.key] != "" && eles[elem.key] != null) {
//如果数据字典项对应的DirName字段存在,通过name查询到对应的code,然后赋值
eles[elem.key] = this.$u.dirCode(
this.$store.getters.dictionaryByKey(elem.code),
eles[elem.key]
);
if (
eles[elem.key] &&
eles[elem.key] != "" &&
eles[elem.key] != null
) {
//如果数据字典项对应的DirName字段存在,通过name查询到对应的code,然后赋值。
let codeArr = []
let keyValue = eles[elem.key]
if (keyValue.length > 0 && (keyValue.indexOf(',') > -1 || keyValue.indexOf(',') > -1)) { //如果对应的数据包含多个数据字典项,比如包含“,”或“,”
if (keyValue.indexOf(',') > -1) {
codeArr = keyValue.split(',')
}
if (keyValue.indexOf > -1) {
codeArr = keyValue.split(',')
}
}
if (codeArr.length <= 1) { //对应的数据包含一个数据字典项
eles[elem.key] = this.$u.dirCode(
this.$store.getters.dictionaryByKey(elem.code),
eles[elem.key]
);
} else { //对应的数据包含多个数据字典项
let codeInfo = ''
codeArr.forEach(el => {
codeInfo = codeInfo + this.$u.dirCode(this.$store.getters.dictionaryByKey(elem.code), el) + ",";
})
eles[elem.key] = codeInfo.substr(0, codeInfo.length - 1)
}
}
});
......
This diff is collapsed.
......@@ -1177,6 +1177,8 @@ export default {
requestUrl: '服务地址',
requestParam: '参数',
exception: '异常详细信息',
remark:'备注'
},
user_message_config: {
creationTime: '创建时间',
......
<template>
<span class="i-layout-header-trigger i-layout-header-trigger-min">
<Dropdown :trigger="isMobile ? 'click' : 'hover'" class="i-layout-header-i18n" :class="{ 'i-layout-header-user-mobile': isMobile }" @on-click="handleClick">
<Icon type="md-globe" />
<DropdownMenu slot="list">
<DropdownItem v-for="(item, key) in languages" :key="key" :name="key" :selected="locale === key">
<span>{{ item.language }}</span>
</DropdownItem>
</DropdownMenu>
</Dropdown>
</span>
<span class="i-layout-header-trigger i-layout-header-trigger-min">
<Dropdown transfer :trigger="isMobile ? 'click' : 'hover'" class="i-layout-header-i18n" :class="{ 'i-layout-header-user-mobile': isMobile }" @on-click="handleClick">
<Icon type="md-globe" />
<DropdownMenu slot="list">
<DropdownItem v-for="(item, key) in languages" :key="key" :name="key" :selected="locale === key">
<span>{{ item.language }}</span>
</DropdownItem>
</DropdownMenu>
</Dropdown>
</span>
</template>
<script>
import Languages from '@/i18n/locale';
import { mapState, mapActions } from 'vuex';
import Languages from '@/i18n/locale';
import {
mapState,
mapActions
} from 'vuex';
export default {
name: 'iHeaderI18n',
data () {
return {
languages: Languages
}
},
computed: {
...mapState('admin/i18n', [
'locale'
]),
...mapState('admin/layout', [
'isMobile'
])
},
methods: {
...mapActions('admin/i18n', [
'setLocale'
]),
handleClick (locale) {
if (locale === this.locale) return;
this.setLocale({ locale, vm: this });
}
export default {
name: 'iHeaderI18n',
data() {
return {
languages: Languages
}
},
computed: {
...mapState('admin/i18n', [
'locale'
]),
...mapState('admin/layout', [
'isMobile'
])
},
methods: {
...mapActions('admin/i18n', [
'setLocale'
]),
handleClick(locale) {
if (locale === this.locale) return;
this.setLocale({
locale,
vm: this
});
}
}
}
</script>
<template>
<span class="i-layout-header-trigger i-layout-header-trigger-min">
<Dropdown
:trigger="isMobile ? 'click' : 'hover'"
class="i-layout-header-user"
:class="{ 'i-layout-header-user-mobile': isMobile }"
@on-click="handleClick"
>
<Avatar size="small" :src="info.avatar" v-if="info.avatar" />
<Avatar size="small" style="background-color: #87d068" icon="ios-person" v-else-if="!info.avatar" />
<span class="i-layout-header-user-name" v-if="!isMobile">{{ info.name }}</span>
<DropdownMenu slot="list">
<i-link to="/basicData/userManagent/userInfo">
<DropdownItem>
<Icon type="ios-contact-outline" />
<span>{{ $t('basicLayout.user.center') }}</span>
</DropdownItem>
</i-link>
<!-- <i-link to="/setting/account">
<span class="i-layout-header-trigger i-layout-header-trigger-min">
<Dropdown transfer :trigger="isMobile ? 'click' : 'hover'" class="i-layout-header-user" :class="{ 'i-layout-header-user-mobile': isMobile }" @on-click="handleClick">
<Avatar size="small" :src="info.avatar" v-if="info.avatar" />
<Avatar size="small" style="background-color: #87d068" icon="ios-person" v-else-if="!info.avatar" />
<span class="i-layout-header-user-name" v-if="!isMobile">{{ info.name }}</span>
<DropdownMenu slot="list">
<i-link to="/basicData/userManagent/userInfo">
<DropdownItem>
<Icon type="ios-contact-outline" />
<span>{{ $t('basicLayout.user.center') }}</span>
</DropdownItem>
</i-link>
<!-- <i-link to="/setting/account">
<DropdownItem>
<Icon type="ios-settings-outline" />
<span>{{ $t('basicLayout.user.setting') }}</span>
</DropdownItem>
</i-link> -->
<DropdownItem divided name="logout">
<Icon type="ios-log-out" />
<span>{{ $t('basicLayout.user.logOut') }}</span>
</DropdownItem>
</DropdownMenu>
<DropdownItem divided name="logout">
<Icon type="ios-log-out" />
<span>{{ $t('basicLayout.user.logOut') }}</span>
</DropdownItem>
</DropdownMenu>
</Dropdown>
</span>
</span>
</template>
<script>
import { mapState, mapActions } from "vuex";
import {
mapState,
mapActions
} from "vuex";
export default {
name: "iHeaderUser",
computed: {
...mapState("admin/user", ["info"]),
...mapState("admin/layout", ["isMobile", "logoutConfirm"])
},
methods: {
...mapActions("admin/account", ["logout"]),
handleClick(name) {
if (name === "logout") {
this.logout({
confirm: this.logoutConfirm,
vm: this
});
}
name: "iHeaderUser",
computed: {
...mapState("admin/user", ["info"]),
...mapState("admin/layout", ["isMobile", "logoutConfirm"])
},
methods: {
...mapActions("admin/account", ["logout"]),
handleClick(name) {
if (name === "logout") {
this.logout({
confirm: this.logoutConfirm,
vm: this
});
}
}
}
}
};
</script>
......@@ -4943,7 +4943,7 @@
"dependencies": {
"commander": {
"version": "2.14.1",
"resolved": "http://r.cnpmjs.org/commander/download/commander-2.14.1.tgz",
"resolved": "https://registry.npm.taobao.org/commander/download/commander-2.14.1.tgz?cache=0&sync_timestamp=1595168224685&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcommander%2Fdownload%2Fcommander-2.14.1.tgz",
"integrity": "sha1-IjUSPjevjKPGXfRbAm29NXsBuao="
}
}
......@@ -5472,7 +5472,7 @@
},
"crc-32": {
"version": "1.2.0",
"resolved": "http://r.cnpmjs.org/crc-32/download/crc-32-1.2.0.tgz",
"resolved": "https://registry.npm.taobao.org/crc-32/download/crc-32-1.2.0.tgz",
"integrity": "sha1-yy224puIUI4y2d0OwWk+e0Ghggg=",
"requires": {
"exit-on-epipe": "~1.0.1",
......@@ -7369,7 +7369,7 @@
},
"exit-on-epipe": {
"version": "1.0.1",
"resolved": "http://r.cnpmjs.org/exit-on-epipe/download/exit-on-epipe-1.0.1.tgz",
"resolved": "https://registry.npm.taobao.org/exit-on-epipe/download/exit-on-epipe-1.0.1.tgz",
"integrity": "sha1-C92S6H1ShdJn2qgXHQ6wYVlolpI="
},
"expand-brackets": {
......@@ -8020,7 +8020,7 @@
},
"frac": {
"version": "1.1.2",
"resolved": "http://r.cnpmjs.org/frac/download/frac-1.1.2.tgz",
"resolved": "https://registry.npm.taobao.org/frac/download/frac-1.1.2.tgz",
"integrity": "sha1-PXT39keMiKG1AgMG10fcYxPHTQs="
},
"fragment-cache": {
......@@ -15097,7 +15097,7 @@
},
"printj": {
"version": "1.1.2",
"resolved": "http://r.cnpmjs.org/printj/download/printj-1.1.2.tgz",
"resolved": "https://registry.npm.taobao.org/printj/download/printj-1.1.2.tgz",
"integrity": "sha1-2Q3rKXWoufYA+zoclOP0xTx4oiI="
},
"private": {
......@@ -20550,7 +20550,7 @@
},
"script-loader": {
"version": "0.7.2",
"resolved": "http://r.cnpmjs.org/script-loader/download/script-loader-0.7.2.tgz",
"resolved": "https://registry.npm.taobao.org/script-loader/download/script-loader-0.7.2.tgz",
"integrity": "sha1-IBbbb4byX1z1baOJFdgzeLsWa6c=",
"dev": true,
"requires": {
......@@ -21138,7 +21138,7 @@
},
"ssf": {
"version": "0.10.3",
"resolved": "http://r.cnpmjs.org/ssf/download/ssf-0.10.3.tgz",
"resolved": "https://registry.npm.taobao.org/ssf/download/ssf-0.10.3.tgz",
"integrity": "sha1-jq4fwpyQpVLnkhII+BiS1vd6yys=",
"requires": {
"frac": "~1.1.2"
......@@ -23805,7 +23805,7 @@
},
"wmf": {
"version": "1.0.2",
"resolved": "http://r.cnpmjs.org/wmf/download/wmf-1.0.2.tgz",
"resolved": "https://registry.npm.taobao.org/wmf/download/wmf-1.0.2.tgz",
"integrity": "sha1-fRnWIQcaCMK9xrfmiKnENSmMwto="
},
"word-wrap": {
......@@ -23960,7 +23960,7 @@
},
"xlsx": {
"version": "0.15.6",
"resolved": "http://r.cnpmjs.org/xlsx/download/xlsx-0.15.6.tgz",
"resolved": "https://registry.npm.taobao.org/xlsx/download/xlsx-0.15.6.tgz?cache=0&sync_timestamp=1597272342311&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fxlsx%2Fdownload%2Fxlsx-0.15.6.tgz",
"integrity": "sha1-Rh+EHW2eoag3XizSRr8jrs4IodU=",
"requires": {
"adler-32": "~1.2.0",
......@@ -23975,7 +23975,7 @@
"dependencies": {
"commander": {
"version": "2.17.1",
"resolved": "http://r.cnpmjs.org/commander/download/commander-2.17.1.tgz",
"resolved": "https://registry.npm.taobao.org/commander/download/commander-2.17.1.tgz?cache=0&sync_timestamp=1595168224685&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcommander%2Fdownload%2Fcommander-2.17.1.tgz",
"integrity": "sha1-vXerfebelCBc6sxy8XFtKfIKd78="
}
}
......
......@@ -85,14 +85,14 @@ export default {
}).then(r => {
if (r > 0) {
this.$Message.success("登陆成功!");
this.initUserInfo(r);
this.initUserInfo(r, tenantcode);
} else {
this.$Message.error("登陆失败!");
}
});
}
},
initUserInfo(id) {
initUserInfo(id, tenantCode) {
let parma = {
Id: id
};
......@@ -106,8 +106,7 @@ export default {
res.result.avatarUrl = fileUrlDown + res.result.avatarUrl;
}
let info = res.result;
info.tenantCode =
info.auth = ["admin"];
info.tenantCode = tenantCode;
info.avatar = info.avatarUrl;
info.userId = info.id;
info.name = info.userName;
......
......@@ -7,7 +7,7 @@
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('departcode')">
<FormItem :label="l('departcode')" prop="departcode">
<Input v-model="entity.departcode" placeholder="请输入..."></Input>
</FormItem>
</Col>
......@@ -20,10 +20,9 @@
</Col>-->
<Col :span="12">
<FormItem :label="l('upMent')">
<b>{{entity.name}}</b>
<b>{{ entity.name }}</b>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('cityName')">
<Cascader :data="citys" v-model="location"></Cascader>
......@@ -44,7 +43,9 @@
</Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Button type="primary" @click="handleSubmit" :disabled="disabled"
>保存</Button
>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
<!-- 组织类型 -->
......@@ -63,6 +64,18 @@ export default {
name: "Add",
// components: { OrganizType },
data() {
const validateCode = (rule, value, callback) => {
if (!value) {
return callback(new Error("编号不能为空"));
}
Api.isExist(value).then((r) => {
if (r.result) {
return callback(new Error("编号已经存在"));
} else {
callback();
}
});
};
return {
// showTree: false, //组织类型
disabled: false,
......@@ -73,33 +86,37 @@ export default {
organization_Id: 0,
organization_Type: "",
departcode: "",
name:'',
name: "",
},
property: [],
location: [],
rules: {
title02: [
{ required: true, message: "库位名不能为空", trigger: "blur" }
{ required: true, message: "库位名不能为空", trigger: "blur" },
],
organizationType: [
{
required: true,
message: "组织类型不能为空",
trigger: "blur"
}
]
}
trigger: "blur",
},
],
departcode: [
{ required: true, message: "编码不能为空", trigger: "blur" },
{ validator: validateCode, trigger: "blur" },
],
},
};
},
props: {
val: Object
val: Object,
},
created() {
// this.entity = {};
},
methods: {
handleSubmit() {
this.$refs["form"].validate(value => {
this.$refs["form"].validate((value) => {
if (value) {
let isProduction = 0;
let property = [];
......@@ -120,18 +137,18 @@ export default {
}
let location = this.location;
let paramsdata = {
parentTitle:this.entity.name,
parentTitle: this.entity.name,
name: this.entity.title02, //部门名称
parent_Id: this.entity.id, //上级部门 [id]
code: this.entity.departcode, //部门编号
// organization_Id: this.entity.organization_Id, //组织类型 [id]
location: location.join(","), //省市县
isProduction:isProduction, //是否生产班组:1是,0否
property: property.join(",") //属性
isProduction: isProduction, //是否生产班组:1是,0否
property: property.join(","), //属性
};
Api.create(paramsdata)
.then(r => {
.then((r) => {
this.disabled = false;
if (r.success) {
this.$Message.success("保存成功!");
......@@ -140,7 +157,7 @@ export default {
this.$Message.error("保存失败,请联系管理员");
}
})
.catch(err => {
.catch((err) => {
this.disabled = false;
this.$Message.error("保存失败,请联系管理员");
});
......@@ -156,7 +173,7 @@ export default {
l(key) {
key = "DipartLocation" + "." + key;
return this.$t(key);
}
},
},
watch: {
val(v) {
......@@ -164,7 +181,7 @@ export default {
this.entity = {};
this.entity.name = v.name;
this.entity.id = v.id;
}
}
},
},
};
</script>
\ No newline at end of file
......@@ -7,7 +7,7 @@
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('departcode')">
<FormItem :label="l('departcode')" prop="departcode">
<Input v-model="entity.departcode" placeholder="请输入..."></Input>
</FormItem>
</Col>
......@@ -39,7 +39,9 @@
</Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Button type="primary" @click="handleSubmit" :disabled="disabled"
>保存</Button
>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
<!-- 组织类型 -->
......@@ -58,6 +60,18 @@ export default {
name: "Add",
// components: { OrganizType },
data() {
const validateCode = (rule, value, callback) => {
if (!value) {
return callback(new Error("编号不能为空"));
}
Api.isExist(value).then((r) => {
if (r.result) {
return callback(new Error("编号已经存在"));
} else {
callback();
}
});
};
return {
// showTree: false, //组织类型
disabled: false,
......@@ -67,28 +81,31 @@ export default {
// organizationType: ""
departcode: "",
title02: "",
},
property: [],
location: [],
rules: {
title02: [
{ required: true, message: "库位名不能为空", trigger: "blur" }
{ required: true, message: "名称不能为空", trigger: "blur" },
],
organizationType: [
{
// type: 'array',
required: true,
message: "组织类型不能为空",
trigger: "blur"
}
]
}
trigger: "blur",
},
],
departcode: [
{ required: true, message: "编码不能为空", trigger: "blur" },
{ validator: validateCode, trigger: "blur" },
],
},
};
},
methods: {
handleSubmit() {
this.$refs["form"].validate(value => {
this.$refs["form"].validate((value) => {
if (value) {
let isProduction = 0;
let property = [];
......@@ -109,17 +126,17 @@ export default {
}
let location = this.location;
let paramsdata = {
parentTitle:'',
parentTitle: "",
name: this.entity.title02, //部门名称
parent_Id: 0, //上级部门 [id]
code: this.entity.departcode, //部门编号
organization_Id: this.entity.organization_Id, //组织类型 [id]
location: location.join(","), //省市县
isProduction: isProduction, //是否生产班组:1是,0否
property: property.join(",") //属性
property: property.join(","), //属性
};
Api.create(paramsdata)
.then(r => {
.then((r) => {
this.disabled = false;
if (r.success) {
this.$Message.success("保存成功!");
......@@ -128,7 +145,7 @@ export default {
this.$Message.error("保存失败,请联系管理员");
}
})
.catch(err => {
.catch((err) => {
this.disabled = false;
this.$Message.error("保存失败,请联系管理员");
});
......@@ -144,7 +161,7 @@ export default {
l(key) {
key = "DipartLocation" + "." + key;
return this.$t(key);
}
}
},
},
};
</script>
\ No newline at end of file
......@@ -20,5 +20,8 @@ export default {
departImport(params) {
return Api.post(`${systemUrl}/departmentimport/import`, params);
},
// 编号是否存在
isExist(value) {
return Api.post(`${systemUrl}/Department/IsExist`, value);
},
}
\ No newline at end of file
......@@ -7,7 +7,7 @@
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('departcode')">
<FormItem :label="l('departcode')" prop="code">
<Input v-model="entity.code" placeholder="请输入..."></Input>
</FormItem>
</Col>
......@@ -72,7 +72,8 @@ export default {
id: -1
},
rules: {
name: [{ required: true, message: "库位名不能为空", trigger: "blur" }],
name: [{ required: true, message: "不能为空", trigger: "blur" }],
code: [{ required: true, message: "不能为空", trigger: "blur" }],
property: [
{
required: true,
......
......@@ -353,12 +353,38 @@ export default {
});
list.forEach((e) => {
//给导出数据增加数据字典对应的name
tempCol.forEach((ele) => {
e[ele.key] = this.$u.dirName(
this.$store.getters.dictionaryByKey(ele.code),
e[ele.key]
);
tempCol.forEach((elem) => {
if (
e[elem.key] &&
e[elem.key] != "" &&
e[elem.key] != null
) {
//如果数据字典项对应的DirName字段存在,通过name查询到对应的code,然后赋值。
let codeArr = []
let keyValue = e[elem.key]
if (keyValue.length > 0 && (keyValue.indexOf(',') > -1 || keyValue.indexOf(',') > -1)) { //如果对应的数据包含多个数据字典项,比如包含“,”或“,”
if (keyValue.indexOf(',') > -1) {
codeArr = keyValue.split(',')
}
if (keyValue.indexOf > -1) {
codeArr = keyValue.split(',')
}
}
if (codeArr.length <= 1) { //对应的数据包含一个数据字典项
e[elem.key] = this.$u.dirName(
this.$store.getters.dictionaryByKey(elem.code),
e[elem.key]
);
} else { //对应的数据包含多个数据字典项
let codeInfo = ''
codeArr.forEach(el => {
codeInfo = codeInfo + this.$u.dirName(this.$store.getters.dictionaryByKey(elem.code), el) + ",";
})
e[elem.key] = codeInfo.substr(0, codeInfo.length - 1)
}
}
});
tempCol1.forEach((ele1) => {
e[ele1.key] = this.getCityName(e[ele1.key]);
});
......@@ -399,7 +425,7 @@ export default {
parent_Id: ele.parent_Id ? ele.parent_Id : '', //上级部门 [id]
code: ele.code ? ele.code : '', //部门编号
location: ele.location ? this.getCityValue(ele.location) : '', //省市县
isProduction: 0, //是否生产班组:1是,0否
isProduction: ele.property.indexOf('1') > -1 && ele.property.indexOf('2') > -1 && ele.property.indexOf('3') > -1 ? 1 : 0, //是否生产班组:1是,0否. 属性值为三个值同时选择,则是生产班组
property: ele.property ? ele.property : '' //属性
};
if (ele.name && ele.name != '') {
......
......@@ -72,6 +72,11 @@
<FormItem :label="l('property')">
<Checkbox v-model="entity.property">排产资源</Checkbox>
</FormItem>
</Col>
<Col :span="12">
<FormItem label="用户类型">
<Dictionary code="User.base.UserType" v-model="entity.userType"></Dictionary>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('remark')" prop="remark">
......
This diff is collapsed.
<template>
<div class="detail">
<Row>
<!-- <Filed :span="12" :name="l('creationTime')">{{entity.creationTime}}</Filed>
<div class="detail">
<Row>
<!-- <Filed :span="12" :name="l('creationTime')">{{entity.creationTime}}</Filed>
<Filed :span="12" :name="l('creatorUserId')">{{entity.creatorUserId}}</Filed>
<Filed :span="12" :name="l('lastModificationTime')">{{entity.lastModificationTime}}</Filed>
<Filed :span="12" :name="l('lastModifierUserId')">{{entity.lastModifierUserId}}</Filed>
<Filed :span="12" :name="l('isDeleted')">{{entity.isDeleted}}</Filed>
<Filed :span="12" :name="l('deletionTime')">{{entity.deletionTime}}</Filed>
<Filed :span="12" :name="l('deleterUserId')">{{entity.deleterUserId}}</Filed> -->
<Filed :span="12" :name="l('timestamp')">{{entity.timestamp}}</Filed>
<Filed :span="12" :name="l('level')">{{entity.level}}</Filed>
<!-- <Filed :span="12" :name="l('messageTemplate')">{{entity.messageTemplate}}</Filed> -->
<Filed :span="12" :name="l('renderedMessage')">{{entity.renderedMessage}}</Filed>
<Filed :span="12" :name="l('clientIpAddress')">{{entity.clientIpAddress}}</Filed>
<Filed :span="12" :name="l('loginName')">{{entity.loginName}}</Filed>
<Filed :span="12" :name="l('tanentCode')">{{entity.tanentCode}}</Filed>
<Filed :span="12" :name="l('host')">{{entity.host}}</Filed>
<Filed :span="12" :name="l('status')">{{entity.status}}</Filed>
<Filed :span="12" :name="l('requestUrl')">{{entity.requestUrl}}</Filed>
<Filed :span="12" :name="l('requestParam')">{{entity.requestParam}}</Filed>
<Filed :span="24" :name="l('exception')">{{entity.exception}}</Filed>
</Row>
</div>
<Filed :span="12" :name="l('timestamp')">{{ entity.timestamp }}</Filed>
<Filed :span="12" :name="l('level')">{{ entity.level }}</Filed>
<!-- <Filed :span="12" :name="l('messageTemplate')">{{entity.messageTemplate}}</Filed> -->
<Filed :span="12" :name="l('renderedMessage')">{{
entity.renderedMessage
}}</Filed>
<Filed :span="12" :name="l('clientIpAddress')">{{
entity.clientIpAddress
}}</Filed>
<Filed :span="12" :name="l('loginName')">{{ entity.loginName }}</Filed>
<Filed :span="12" :name="l('tanentCode')">{{ entity.tanentCode }}</Filed>
<Filed :span="12" :name="l('host')">{{ entity.host }}</Filed>
<Filed :span="12" :name="l('status')">{{ entity.status }}</Filed>
<Filed :span="12" :name="l('requestUrl')">{{ entity.requestUrl }}</Filed>
<Filed :span="12" :name="l('requestParam')">{{
entity.requestParam
}}</Filed>
<Filed :span="24" :name="l('exception')">{{ entity.exception }}</Filed>
</Row>
<Form
class="form"
ref="form"
:model="entity"
:rules="rules"
:label-width="90"
>
<Row>
<Col :span="12">
<FormItem :label="l('status')" prop="status">
<Dictionary
code="error.status"
v-model="entity.status"
type="radio"
></Dictionary>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('remark')" prop="remark">
<Input v-model="entity.remark" type="textarea" :rows="5"></Input>
</FormItem>
</Col>
</Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled"
>保存</Button
>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Form>
</div>
</template>
<script>
import Api from './api'
export default {
name: 'Add',
data() {
return {
entity: {},
rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }],
code: [{ required: true, message: '必填', trigger: 'blur' }]
}
}
},
props: {
eid: Number
},
mounted() {
if (this.eid) {
this.load(this.eid);
}
},
methods: {
load(v) {
Api.get({ id: v }).then(r => {
this.entity = r.result;
this.$emit('on-load')
})
},
handleClose() {
this.$emit('on-close')
},
l(key) {
key = "run_log" + "." + key;
return this.$t(key)
}
},
watch: {
eid(v) {
if (v > 0) {
this.load(v);
}
}
}
import Api from "./api";
export default {
name: "Add",
data() {
return {
entity: {
exception: "",
properties: {},
status: 0,
},
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }],
code: [{ required: true, message: "必填", trigger: "blur" }],
},
disabled: false,
};
},
props: {
eid: "",
},
mounted() {
if (this.eid) {
this.load(this.eid);
}
},
methods: {
load(v) {
Api.get({ id: v }).then((r) => {
if (r.result.status == "" || r.result.status == null) {
r.result.status = 0;
}
this.entity = r.result;
this.$emit("on-load");
});
},
handleClose() {
this.$emit("on-close");
},
l(key) {
key = "run_log" + "." + key;
return this.$t(key);
},
handleSubmit() {
this.disabled = true;
Api.update({
id: this.entity.id,
status: this.entity.status,
remark: this.entity.remark,
})
.then((r) => {
this.disabled = false;
if (r.success) {
this.$Message.success("保存成功");
this.$emit("on-ok");
} else {
this.$Message.error("保存失败");
}
})
.catch((err) => {
this.disabled = false;
this.$Message.error("保存失败");
cosole.warn(err);
});
},
},
watch: {
eid(v) {
if (v > 0) {
this.load(v);
}
},
},
};
</script>
\ No newline at end of file
<template>
<div>
<DataGrid :columns="columns" ref="grid" :action="action">
<DataGrid
:columns="columns"
ref="grid"
:action="action"
exportTitle="异常记录"
>
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys">
<Input placeholder="请输入关键字登录账号/租户编号" v-model="easySearch.keys.value" v-width="300"/>
<Input
placeholder="请输入关键字登录账号/租户编号"
v-model="easySearch.keys.value"
v-width="300"
/>
</FormItem>
<FormItem>
<Button type="primary" @click="search">查询</Button>
......@@ -15,7 +24,12 @@
<Search />
</template>
<template slot="buttons">
<DatePicker type="date" v-model="end" placeholder="选择终止日期" style="width: 150px"></DatePicker>
<DatePicker
type="date"
v-model="end"
placeholder="选择终止日期"
style="width: 150px"
></DatePicker>
<Button type="error" @click="clear" :disabled="dis">清理</Button>
</template>
</DataGrid>
......@@ -24,6 +38,7 @@
</Modal>
</div>
</template>
<script>
import Api from "./api";
import Search from "./search";
......@@ -41,9 +56,12 @@ export default {
return {
action: Api.index,
easySearch: {
keys: { op: "loginName,tanentCode", value: null },
keys: {
op: "loginName,tanentCode",
value: null,
},
},
end:null,
end: null,
modal: false,
title: "新增",
detail: null,
......@@ -124,8 +142,16 @@ export default {
hide: true,
high: true,
},
// { key:"status",title:this.l("status") ,align:"left" ,high:true },
{
key: "status",
title: this.l("status"),
align: "left",
high: true,
render: (h, params) => {
return h("span", {}, params.row.status == 1 ? "已解决" : "未解决");
},
},
{ key: "remark", title: this.l("remark"), align: "left", high: true },
{
key: "requestParam",
title: this.l("requestParam"),
......@@ -140,34 +166,48 @@ export default {
width: 140,
align: "center",
render: (h, params) => {
return h("div", { class: "action" }, [
h(
"op",
{
attrs: { oprate: "detail" },
on: { click: () => this.view(params.row.id) },
},
"查看"
),
//h('op', { attrs: { oprate: 'copy' }, on: { click: () => this.copy(params.row.id) } }, '克隆'),
// h('op', { attrs: { oprate: 'edit'}, on: { click: () => this.edit(params.row.id) } }, '编辑'),
h(
"op",
{
attrs: { oprate: "delete" },
on: { click: () => this.remove(params.row.id) },
},
"删除"
),
]);
return h(
"div",
{
class: "action",
},
[
h(
"op",
{
attrs: {
oprate: "detail",
},
on: {
click: () => this.view(params.row.id),
},
},
"查看"
),
//h('op', { attrs: { oprate: 'copy' }, on: { click: () => this.copy(params.row.id) } }, '克隆'),
// h('op', { attrs: { oprate: 'edit'}, on: { click: () => this.edit(params.row.id) } }, '编辑'),
h(
"op",
{
attrs: {
oprate: "delete",
},
on: {
click: () => this.remove(params.row.id),
},
},
"删除"
),
]
);
},
},
],
};
},
created() {
var date=new Date().getTime()-24*60*60*1000*5;
this.end=new Date(date);
var date = new Date().getTime() - 24 * 60 * 60 * 1000 * 5;
this.end = new Date(date);
console.log(this);
},
......@@ -215,21 +255,21 @@ export default {
}
});
},
clear(){
this.$Modal.confirm({
title:"确认",
content:"确认要删除"+this.$u.toDate(this.end) +"以前的数据吗",
onOk:()=>{
Api.deleteAll(this.end).then(r=>{
if(r.success){
this.$Message.success("删除成功")
this.$refs.grid.load();
}else{
this.$Message.error("出现异常")
}
})
clear() {
this.$Modal.confirm({
title: "确认",
content: "确认要删除" + this.$u.toDate(this.end) + "以前的数据吗",
onOk: () => {
Api.deleteAll(this.end).then((r) => {
if (r.success) {
this.$Message.success("删除成功");
this.$refs.grid.load();
} else {
this.$Message.error("出现异常");
}
})
});
},
});
},
cancel() {
this.curId = 0;
......@@ -237,39 +277,41 @@ export default {
},
l(key) {
/*
run_log:{
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
timestamp:'异常发生时间',
level:'日志级别',
messageTemplate:'消息模板',
renderedMessage:'异常信息',
clientIpAddress:'客户端IP',
loginName:'登录账号',
tanentCode:'租户编号',
host:'主机IP',
status:'状态',
requestUrl:'服务地址',
requestParam:'参数',
exception:'异常详细信息',
}
*/
run_log:{
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
timestamp:'异常发生时间',
level:'日志级别',
messageTemplate:'消息模板',
renderedMessage:'异常信息',
clientIpAddress:'客户端IP',
loginName:'登录账号',
tanentCode:'租户编号',
host:'主机IP',
status:'状态',
requestUrl:'服务地址',
requestParam:'参数',
exception:'异常详细信息',
}
*/
let vkey = "run_log" + "." + key;
return this.$t(vkey) || key;
},
},
computed:{
dis(){
var num=(new Date().getTime()-this.end.getTime())/(1000*60*60*24);
return num<1
}
}
computed: {
dis() {
var num =
(new Date().getTime() - this.end.getTime()) / (1000 * 60 * 60 * 24);
return num < 1;
},
},
};
</script>
<style lang="less">
</style>
\ No newline at end of file
</style>
......@@ -4,12 +4,4 @@
<h2>欢迎登陆!</h2>
</div>
</template>
<script>
// import iview from './crm/statistical/index.vue'
export default {
// components: {
// iview
// }
}
</script>
\ No newline at end of file
</template>
\ No newline at end of file
This diff is collapsed.
......@@ -53,7 +53,7 @@ function errorLog (err) {
// 创建一个 axios 实例
const service = axios.create({
baseURL: Setting.apiBaseURL,
timeout: 5000, // 请求超时时间
timeout: 30000, // 请求超时时间
transformRequest:[(data)=>{
function dateFormat(date, fmt) {
if (null == date || undefined == date) return '';
......
......@@ -8,6 +8,46 @@ html body {
#__layout {
height: 100%;
}
/*flex*/
.flex {
display: flex;
}
.fc-m {
justify-content: center;
}
.fa-m {
align-items: center;
}
.fc-e {
justify-content: flex-end;
}
.fc-b {
justify-content: space-between;
}
.fc-a {
justify-content: space-around;
}
.fc-ev {
justify-content: space-evenly;
}
.fd {
flex-direction: column;
}
.fg {
flex-grow: 1;
}
.fs {
flex-shrink: 0;
}
.fg2 {
flex-grow: 2;
}
.fos {
order: -1;
}
.foe {
order: 99;
}
/*字体*/
.ib {
display: inline;
......@@ -172,6 +212,12 @@ html body {
.pl20 {
padding-left: 20px;
}
.pr10 {
padding-right: 10px;
}
.pr20 {
padding-right: 20px;
}
.bnone {
border: none;
}
......@@ -475,6 +521,15 @@ i.icon-gengxin {
.tc {
text-align: center;
}
.lt30 {
line-height: 30px;
}
.lt40 {
line-height: 40px;
}
.lt50 {
line-height: 50px;
}
/*清除浮动*/
.clear {
clear: both;
......@@ -523,6 +578,7 @@ textarea::-webkit-input-placeholder {
background: #fff;
padding: 0px 10px 20px 10px;
margin-top: 10px;
overflow: auto;
}
.zh-tree .zh-title {
font-size: 14px;
......@@ -646,7 +702,7 @@ html [type=button] {
}
.waitTask {
/*flex 布局*/
display: flex;
display: flex!important;
align-items: center;
width: 200px;
height: 100px;
......@@ -892,7 +948,6 @@ html [type=button] {
color: #249e91;
}
.full .menu .tree {
height: calc(100% - 150px);
overflow: auto;
}
.full .content {
......@@ -922,3 +977,7 @@ html [type=button] {
.content {
padding-left: 5px;
}
.row_border_bottom {
border-bottom: 1px solid #E0E0E0;
padding: 15px 20px;
}
......@@ -10,6 +10,7 @@ let address=systemApi.dev;
//let address=systemApi.local;
window.systemUrl = `http://${address}:10000/system`; //System-api 系统管理(基础数据)
// window.systemUrl = `http://localhost:10020/api/services/app`; //System-api 系统管理(基础数据)
window.authUrl = `http://${address}:10010`; //Authentication-api //统一登陆认证
window.UserUrl = `http://${address}:10130`; //Authentication-api //用户信息 密码修改。重置等
window.designUrl = `http://${address}:10000/process`; // 工艺规程
......
import createVuexAlong from 'vuex-along'
import Api from '@/plugins/request'
import util from '@/libs/util';
export const state = () => ({
counter: 0,
dictionary: new Map(), //所有字典项
......@@ -11,6 +12,8 @@ export const state = () => ({
},
siteConfig: {},
defaultConfig: {},
configId:null,
configSaveStatu:0,
})
export const getters = {
dictionaryByKey: (state) => (key) => {
......@@ -56,10 +59,16 @@ export const mutations = {
state.dictionary = dictionary;
},
setSiteConfig(state, config) {
state.siteConfig = config;
state.siteConfig = JSON.parse(config);
},
setDefaultConfig(state, config) {
state.defaultConfig = config;
state.defaultConfig =JSON.parse(config);
},
setConfigId(state, id) {
state.configId =id;
},
setConfigSaveStatu(state, val) {
state.configSaveStatu =val;
}
}
......@@ -99,28 +108,56 @@ export const actions = {
}) {
let params = {
pageSize: 2,
sortBy: "id",
conditions: [{
"fieldName": "key",
"fieldValue": "defaultConfig,tenant-" + state.userInfo.tenantCode,
"fieldName": "component",
"fieldValue": "defaultConfig,tenantConfig_" + util.cookies.get('tenantCode'),
"conditionalType": "In",
}, ]
}]
}
let {
result
} = await Api.post(`${systemUrl}/config/list`, params);
if (result[0]) {
commit("setDefaultConfig", result[0])
commit("setDefaultConfig", result[0].content)
}
if (result[1]) {
commit("setSiteConfig", result[1])
}else{
if(result[0]){
commit("setSiteConfig", result[0])
commit("setSiteConfig", result[1].content)
commit("setConfigId",result[1].id)
} else {
if (result[0]) {
commit("setSiteConfig", result[0].content)
}
}
},
async saveConfig({commit},config){
async saveConfig({
state
}, config) {
if (config.tenantCode != '') {
let configStr=JSON.stringify(config);
let params = {
id: state.configId,
page: "config",
component: "tenantConfig_"+config.tenantCode,
key:config.tenantCode,
content: configStr,
note: "配置信息"
}
await Api.post(`${systemUrl}/config/update`, params);
} else {
config.tenantCode = util.cookies.get('tenantCode')
let configStr=JSON.stringify(config);
let params = {
page: "config",
component: "tenantConfig_"+config.tenantCode,
key:config.tenantCode,
content: configStr,
note: "配置信息"
}
await Api.post(`${systemUrl}/config/create`, params);
}
}
}
......
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