Commit 4b9a5ead authored by renjintao's avatar renjintao

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

parents 1ed98213 9ec8d397
......@@ -1172,5 +1172,26 @@ export default {
requestUrl: '服务地址',
requestParam: '参数',
exception: '异常详细信息',
},
user_message_config: {
creationTime: '创建时间',
creatorUserId: '创建人',
lastModificationTime: '更新时间',
lastModifierUserId: '更新人',
isDeleted: '删除人',
deletionTime: '删除时间',
deleterUserId: '删除人',
categoryName: '名称',
roleIds: '角色Id',
userIds: '用户Id',
isInner: '是否发送站内消息',
isEmail: '是否发送邮件消息',
roles: '角色',
users: '用户',
status: '启用状态',
code: '编码',
template: '模板',
departmentIds: '部门Id',
departments: '部门',
}
}
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row>
<Col :span="12">
<FormItem :label="l('code')" prop="code">
<Input v-model="entity.code"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('categoryName')" prop="categoryName">
<Input v-model="entity.categoryName"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('users')" prop="userIds">
<UserSelect v-model="entity.userIds" :multiple="true" />
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('roles')" prop="roleIds">
<RoleSelect v-model="entity.roleIds" :multiple="true" />
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('departments')" prop="departmentIds">
<DepartmentSelect v-model="entity.departmentIds"/>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('status')" prop="status">
<Dictionary code="message.config.status" v-model="entity.status" type="radio"></Dictionary>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('isInner')" prop="isInner">
<Dictionary code="message.config.isInner" v-model="entity.isInner" type="radio"></Dictionary>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('isEmail')" prop="isEmail">
<Dictionary code="message.config.isInner" v-model="entity.isEmail" type="radio"></Dictionary>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('template')" prop="template">
<Input v-model="entity.template" 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>
</template>
<script>
import Api from "./api";
export default {
name: "Add",
data() {
const validateCode = (rule, value, callback) => {
if (!value) {
return callback(new Error("编号不能为空"));
}
Api.list(value).then(r => {
console.log(r.result)
if (r.result.length > 0) {
return callback(new Error("编号已经存在"));
} else {
callback();
}
});
};
return {
disabled: false,
entity: {
// creationTime: "",
// creatorUserId: null,
// lastModificationTime: "",
// lastModifierUserId: null,
// isDeleted: 0,
// deletionTime: "",
// deleterUserId: null,
code: "",
categoryName: "",
roleIds: [],
userIds: [],
departmentIds: [1],
isInner: 1,
isEmail: 0,
roles: "",
users: "",
departments:"",
status: 1,
},
rules: {
categoryName: [{ required: true, message: "必填", trigger: "blur" }],
code: [{ required: true, message: "必填", trigger: "blur" }, { validator: validateCode, trigger: "blur" }],
},
};
},
props: {
v: Object,
eid: Number,
},
mounted() {
if (this.eid > 0) {
this.load(this.eid);
}
},
methods: {
handleSubmit() {
this.entity.userIds = this.entity.userIds.toString();
this.entity.roleIds = this.entity.roleIds.toString();
this.entity.departmentIds = this.entity.departmentIds.toString();
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true;
Api.create(this.entity)
.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("保存失败");
console.warn(err);
});
}
});
},
handleClose() {
this.$emit("on-close");
},
load(v) {
Api.get({ id: v }).then((r) => {
this.entity = r.result;
this.entity.id = 0;
});
},
l(key) {
key = "user_message_config" + "." + key;
return this.$t(key);
},
},
watch: {
v() {
this.entity = this.$u.clone(this.v);
},
eid(v) {
if (v > 0) {
this.load(v);
}
},
},
};
</script>
\ No newline at end of file
import Api from '@/plugins/request'
export default {
index: `${systemUrl}usermessageconfig/paged`,
paged(params) {
return Api.post(`${systemUrl}usermessageconfig/paged`, params);
},
list(Code) {
var params = {
"conditions": [
{
"fieldName": "Code",
"fieldValue": Code,
"conditionalType": "Equal"
}
],
"pageSize": 3
}
return Api.post(`${systemUrl}usermessageconfig/list`, params);
},
get(params) {
return Api.get(`${systemUrl}usermessageconfig/get`, params);
},
create(params) {
console.log(params)
return Api.post(`${systemUrl}usermessageconfig/create`, params);
},
update(params) {
return Api.post(`${systemUrl}usermessageconfig/update`, params);
},
delete(id) {
return Api.delete(`${systemUrl}usermessageconfig/delete`, { params: { id: id } });
},
deletes(params) {
return Api.post(`${systemUrl}usermessageconfig/batchdelete`, params);
}
}
\ No newline at end of file
<template>
<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('categoryName')">{{entity.categoryName}}</Filed>
<Filed :span="24" :name="l('roleIds')">{{entity.roleIds}}</Filed>
<Filed :span="24" :name="l('userIds')">{{entity.userIds}}</Filed>
<Filed :span="12" :name="l('isInner')">{{entity.isInner}}</Filed>
<Filed :span="12" :name="l('isEmail')">{{entity.isEmail}}</Filed>
<!-- <Filed :span="24" :name="l('roles')">{{entity.roles}}</Filed>
<Filed :span="24" :name="l('users')">{{entity.users}}</Filed> -->
<Filed :span="12" :name="l('status')">{{entity.status}}</Filed>
<Filed :span="12" :name="l('code')">{{entity.code}}</Filed>
<Filed :span="12" :name="l('template')">{{entity.template}}</Filed>
<Filed :span="24" :name="l('departmentIds')">{{entity.departmentIds}}</Filed>
<!-- <Filed :span="24" :name="l('departments')">{{entity.departments}}</Filed> -->
</Row>
</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 > 0) {
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 = "user_message_config" + "." + key;
return this.$t(key)
}
},
watch: {
eid(v) {
if (v > 0) {
this.load(v);
}
}
}
}
</script>
\ No newline at end of file
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row>
<Col :span="12">
<FormItem :label="l('code')" prop="code">
<Input v-model="entity.code" disabled></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('categoryName')" prop="categoryName">
<Input v-model="entity.categoryName"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('users')" prop="userIds">
<UserSelect v-model="entity.userIds" :multiple="true" />
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('roles')" prop="roleIds">
<RoleSelect v-model="entity.roleIds" :multiple="true" />
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('departments')" prop="departmentIds">
<DepartmentSelect v-model="entity.departmentIds"/>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('status')" prop="status">
<Dictionary code="message.config.status" v-model="entity.status" type="radio"></Dictionary>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('isInner')" prop="isInner">
<Dictionary code="message.config.isInner" v-model="entity.isInner" type="radio"></Dictionary>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('isEmail')" prop="isEmail">
<Dictionary code="message.config.isInner" v-model="entity.isEmail" type="radio"></Dictionary>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('template')" prop="template">
<Input v-model="entity.template" 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>
</template>
<script>
import Api from "./api";
export default {
name: "Edit",
data() {
return {
disabled: false,
entity: {},
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }],
},
};
},
props: {
eid: Number,
},
mounted() {
if (this.eid > 0) {
this.load(this.eid);
}
},
updated() {
this.$emit("on-load");
},
methods: {
load(v) {
Api.get({ id: v }).then((r) => {
r.result.userIds = this.$u.toIntArray(r.result.userIds);
r.result.roleIds = this.$u.toIntArray(r.result.roleIds);
r.result.departmentIds = this.$u.toIntArray(r.result.departmentIds);
this.entity = r.result;
});
},
conversionStr(dataIntArr) {
if (dataIntArr == null || dataIntArr.length == 0) {
return "";
}
return dataIntArr.toString();
},
handleSubmit() {
this.entity.userIds = this.conversionStr(this.entity.userIds);
this.entity.roleIds = this.conversionStr(this.entity.roleIds);
this.entity.departmentIds = this.conversionStr(this.entity.departmentIds);
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true;
Api.update(this.entity)
.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("保存失败");
console.warn(err);
});
}
});
},
handleClose() {
this.$emit("on-close");
},
l(key) {
key = "user_message_config" + "." + key;
return this.$t(key);
},
},
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">
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys">
<Input placeholder="请输入关键字分类名称" v-model="easySearch.keys.value" />
</FormItem>
<FormItem>
<Button type="primary" @click="search">查询</Button>
</FormItem>
</Form>
</template>
<template slot="searchForm">
<Search />
</template>
<template slot="buttons">
<Button type="primary" @click="add">新增</Button>
</template>
</DataGrid>
<Modal v-model="modal" :title="title" width="1200" footer-hide>
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" />
</Modal>
</div>
</template>
<script>
import Api from "./api";
import Search from "./search";
export default {
name: "list",
components: {
Search,
},
head: {
title: "用户信息配置表",
author: "henq",
description: "user_message_config 8/20/2020 11:08:36 AM",
},
data() {
return {
action: Api.index,
easySearch: {
keys: { op: "categoryName", value: null },
},
modal: false,
title: "新增",
detail: null,
curId: 0,
columns: [
{
key: "id",
title: this.$t("id"),
hide: true,
align: "left",
high: true,
},
{
key: "creationTime",
title: this.l("creationTime"),
align: "left",
high: true,
},
{
key: "creatorUserId",
title: this.l("creatorUserId"),
align: "left",
high: true,
},
{
key: "lastModificationTime",
title: this.l("lastModificationTime"),
align: "left",
high: true,
},
{
key: "lastModifierUserId",
title: this.l("lastModifierUserId"),
align: "left",
high: true,
},
// {
// key: "isDeleted",
// title: this.l("isDeleted"),
// align: "left",
// high: true,
// },
// {
// key: "deletionTime",
// title: this.l("deletionTime"),
// align: "left",
// high: true,
// },
// {
// key: "deleterUserId",
// title: this.l("deleterUserId"),
// align: "left",
// high: true,
// },
{
key: "code",
title: this.l("code"),
align: "left",
easy: true,
high: true,
},
{
key: "categoryName",
title: this.l("categoryName"),
align: "left",
easy: true,
high: true,
},
{
key: "template",
title: this.l("template"),
align: "left",
easy: true,
high: true,
},
// {
// key: "roles",
// title: this.l("roles"),
// align: "left",
// easy: true,
// high: true,
// },
// {
// key: "users",
// title: this.l("users"),
// align: "left",
// easy: true,
// high: true,
// },
// {
// key: "departments",
// title: this.l("departments"),
// align: "left",
// easy: true,
// high: true,
// },
{
key: "isInner",
title: this.l("isInner"),
align: "left",
high: true,
render: (h, params) => {
return h("span", {}, params.row.isInner == 1 ? "是" : "否");
},
},
{
key: "isEmail",
title: this.l("isEmail"),
align: "left",
high: true,
render: (h, params) => {
return h("span", {}, params.row.isEmail == 1 ? "是" : "否");
},
},
{
key: "status",
title: this.l("status"),
align: "left",
high: true,
render: (h, params) => {
return h("span", {}, params.row.status == 1 ? "启用" : "禁用");
},
},
{
title: "操作",
key: "action",
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) },
},
"删除"
),
]);
},
},
],
};
},
mounted() {
console.log(this);
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: {
ok() {
this.$refs.grid.load();
this.modal = false;
this.curId = 0;
},
search() {
this.$refs.grid.reload(this.easySearch);
},
add() {
this.curId = 0;
this.title = "新增";
this.detail = () => import("./add");
this.modal = true;
},
copy(id) {
this.curId = id;
this.title = "克隆";
this.detail = () => import("./add");
this.modal = true;
},
view(id) {
this.curId = id;
this.title = "详情";
this.detail = () => import("./detail");
this.modal = true;
},
edit(id) {
this.curId = id;
this.title = "编辑";
this.detail = () => import("./edit");
this.modal = true;
},
remove(id) {
Api.delete(id).then((r) => {
if (r.success) {
this.$refs.grid.load();
this.$Message.success("删除成功");
}
});
},
cancel() {
this.curId = 0;
this.modal = false;
},
l(key) {
/*
user_message_config:{
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
categoryName:'分类名称',
roleIds:'接收的角色Id(逗号隔开)',
userIds:'接收的用户Id(逗号隔开)',
isInner:'是否发送站内消息',
isEmail:'是否发送邮件消息',
roles:'接收的角色(逗号隔开)',
users:'接收的用户(逗号隔开)',
status:'启用状态',
}
*/
let vkey = "user_message_config" + "." + key;
return this.$t(vkey) || key;
},
},
};
</script>
<style lang="less">
</style>
\ No newline at end of file
<template>
<Form ref="form" :model="condition" :label-width="90">
<Row>
<Col :span="12" :v-if="condition.id.show">
<FormItem :label="$t('id')" prop="id">
<Input v-model="condition.id.value"></Input>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.code.show">
<FormItem :label="l('code')" prop="code">
<Input v-model="condition.code.value"></Input>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.categoryName.show">
<FormItem :label="l('categoryName')" prop="categoryName">
<Input v-model="condition.categoryName.value"></Input>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.isInner.show">
<FormItem :label="l('isInner')" prop="isInner">
<Dictionary code="message.config.isInner" v-model="condition.isInner.value" type="radio"></Dictionary>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.isEmail.show">
<FormItem :label="l('isEmail')" prop="isEmail">
<Dictionary code="message.config.isInner" v-model="condition.isEmail.value" type="radio"></Dictionary>
</FormItem>
</Col>
<Col :span="12" :v-if="condition.status.show">
<FormItem :label="l('status')" prop="status">
<Dictionary code="message.config.status" v-model="condition.status.value" type="radio"></Dictionary>
</FormItem>
</Col>
</Row>
</Form>
</template>
<script>
import Api from "./api";
export default {
name: "Add",
data() {
return {
condition: {
id: { op: "Equal", value: null, show: true },
creationTime: { op: "Range", value: null, show: true },
creatorUserId: { op: "Equal", value: null, show: true },
lastModificationTime: { op: "Range", value: null, show: true },
lastModifierUserId: { op: "Equal", value: null, show: true },
deletionTime: { op: "Range", value: null, show: true },
categoryName: { op: "Equal", value: null, show: true },
roleIds: { op: "Equal", value: null, show: true },
userIds: { op: "Equal", value: null, show: true },
isInner: { op: "Equal", value: null, show: true },
isEmail: { op: "Equal", value: null, show: true },
roles: { op: "Equal", value: null, show: true },
users: { op: "Equal", value: null, show: true },
status: { op: "Equal", value: null, show: true },
code: { op: "Equal", value: null, show: true },
departmentIds: { op: "Equal", value: null, show: true },
departments: { op: "Equal", value: null, show: true },
},
};
},
methods: {
handleClose() {
this.$emit("on-close");
},
l(key) {
key = "user_message_config" + "." + key;
return this.$t(key);
},
},
};
</script>
\ No newline at end of file
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