Commit e81703d7 authored by 仇晓婷's avatar 仇晓婷

菜单

parent 567d4185
......@@ -1731,5 +1731,19 @@ export default {
templateId:'',
status:'状态',
description:'备注'
}
},
document_template:{
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
name:'名称',
status:'状态',
creator:'创建人',
remark:'',
url:'模板路径',
}
}
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90">
<Row>
<Col :span="12"><FormItem :label="l('creationTime')" prop="creationTime"> <DatePicker type="date" v-model="entity.creationTime"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('creatorUserId')" prop="creatorUserId"> <InputNumber v-model="entity.creatorUserId"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('lastModificationTime')" prop="lastModificationTime"> <DatePicker type="date" v-model="entity.lastModificationTime"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId"> <InputNumber v-model="entity.lastModifierUserId"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('isDeleted')" prop="isDeleted"> <InputNumber v-model="entity.isDeleted"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('deletionTime')" prop="deletionTime"> <DatePicker type="date" v-model="entity.deletionTime"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('deleterUserId')" prop="deleterUserId"> <InputNumber v-model="entity.deleterUserId"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('documentId')" prop="documentId"> <Input v-model="entity.documentId"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('refName')" prop="refName"> <Input v-model="entity.refName"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('refId')" prop="refId"> <Input v-model="entity.refId"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('name')" prop="name"> <Input v-model="entity.name"> </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() {
return {
disabled: false,
entity: {creationTime: null,
creatorUserId: null,
lastModificationTime: null,
lastModifierUserId: null,
isDeleted: null,
deletionTime: null,
deleterUserId: null,
documentId: "",
refName: "",
refId: "",
name: ""},
rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }]
}
}
},
props: {
v: Object,
eid: Number
},
mounted() {
if (this.eid > 0) {
this.load(this.eid);
}
},
methods: {
handleSubmit() {
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 = "document_ref" + "." + 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:`${technologyUrl}documentref/paged`,
paged(params){
return Api.post(`${technologyUrl}documentref/paged`,params);
},
get(params){
return Api.get(`${technologyUrl}documentref/get`,params);
},
create(params){
return Api.post(`${technologyUrl}documentref/create`,params);
},
update(params){
return Api.post(`${technologyUrl}documentref/update`,params);
},
delete(id) {
return Api.delete(`${technologyUrl}documentref/delete`,{params:{id:id}});
},
deletes(params) {
return Api.post(`${technologyUrl}documentref/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('documentId')">{{entity.documentId}}</Filed>
<Filed :span="12" :name="l('refName')">{{entity.refName}}</Filed>
<Filed :span="12" :name="l('refId')">{{entity.refId}}</Filed>
<Filed :span="12" :name="l('name')">{{entity.name}}</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 = "document_ref" + "." + 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('creationTime')" prop="creationTime"> <DatePicker type="date" v-model="entity.creationTime"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('creatorUserId')" prop="creatorUserId"> <InputNumber v-model="entity.creatorUserId"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('lastModificationTime')" prop="lastModificationTime"> <DatePicker type="date" v-model="entity.lastModificationTime"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId"> <InputNumber v-model="entity.lastModifierUserId"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('isDeleted')" prop="isDeleted"> <InputNumber v-model="entity.isDeleted"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('deletionTime')" prop="deletionTime"> <DatePicker type="date" v-model="entity.deletionTime"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('deleterUserId')" prop="deleterUserId"> <InputNumber v-model="entity.deleterUserId"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('documentId')" prop="documentId"> <Input v-model="entity.documentId"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('refName')" prop="refName"> <Input v-model="entity.refName"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('refId')" prop="refId"> <Input v-model="entity.refId"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('name')" prop="name"> <Input v-model="entity.name"> </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);
}
},
methods: {
load(v) {
Api.get({ id: v }).then(r => {
this.entity = r.result;
})
},
handleSubmit() {
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 = "document_ref" + "." + 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: "document_ref 9/18/2020 11:31:43 AM",
},
data() {
return {
action: Api.index,
easySearch: {
keys:{op:"refName,name",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:"documentId",title:this.l("documentId") ,align:"left" ,high:true },
{ key:"refName",title:this.l("refName") ,align:"left" ,easy:true ,high:true },
{ key:"refId",title:this.l("refId") ,align:"left" ,high:true },
{ key:"name",title:this.l("name") ,align:"left" ,easy:true ,high:true },
{
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) {
/*
document_ref:{
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
documentId:'文档id',
refName:'引用的文档名称',
refId:'引用的文档id',
name:'文档名称',
}
*/
let vkey = "document_ref" + "." + 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.creationTime.show"><FormItem :label="l('creationTime')" prop="creationTime"> <DatePicker type="daterange" v-model="condition.creationTime.value"></DatePicker>
</FormItem></Col>
<Col :span="12" :v-if="condition.creatorUserId.show"><FormItem :label="l('creatorUserId')" prop="creatorUserId"> <Input v-model="condition.creatorUserId.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.lastModificationTime.show"><FormItem :label="l('lastModificationTime')" prop="lastModificationTime"> <DatePicker type="daterange" v-model="condition.lastModificationTime.value"></DatePicker>
</FormItem></Col>
<Col :span="12" :v-if="condition.lastModifierUserId.show"><FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId"> <Input v-model="condition.lastModifierUserId.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.deletionTime.show"><FormItem :label="l('deletionTime')" prop="deletionTime"> <DatePicker type="daterange" v-model="condition.deletionTime.value"></DatePicker>
</FormItem></Col>
<Col :span="12" :v-if="condition.documentId.show"><FormItem :label="l('documentId')" prop="documentId"> <Input v-model="condition.documentId.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.refName.show"><FormItem :label="l('refName')" prop="refName"> <Input v-model="condition.refName.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.refId.show"><FormItem :label="l('refId')" prop="refId"> <Input v-model="condition.refId.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.name.show"><FormItem :label="l('name')" prop="name"> <Input v-model="condition.name.value"> </Input>
</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},
documentId:{op:"Equal",value:null,show:true},
refName:{op:"Equal",value:null,show:true},
refId:{op:"Equal",value:null,show:true},
name:{op:"Equal",value:null,show:true},
},
}
},
methods: {
handleClose() {
this.$emit('on-close')
},
l(key) {
key = "document_ref" + "." + key;
return this.$t(key)
}
}
}
</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('creationTime')" prop="creationTime"> <DatePicker type="date" v-model="entity.creationTime"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('creatorUserId')" prop="creatorUserId"> <InputNumber v-model="entity.creatorUserId"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('lastModificationTime')" prop="lastModificationTime"> <DatePicker type="date" v-model="entity.lastModificationTime"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId"> <InputNumber v-model="entity.lastModifierUserId"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('isDeleted')" prop="isDeleted"> <InputNumber v-model="entity.isDeleted"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('deletionTime')" prop="deletionTime"> <DatePicker type="date" v-model="entity.deletionTime"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('deleterUserId')" prop="deleterUserId"> <InputNumber v-model="entity.deleterUserId"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('name')" prop="name"> <Input v-model="entity.name"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('status')" prop="status"> <InputNumber v-model="entity.status"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('creator')" prop="creator"> <Input v-model="entity.creator"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('remark')" prop="remark"> <Input v-model="entity.remark"> </Input>
</FormItem></Col>
<Col :span="24"><FormItem :label="l('url')" prop="url"> <InputFile v-model="entity.url"></InputFile>
</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() {
return {
disabled: false,
entity: {creationTime: null,
creatorUserId: null,
lastModificationTime: null,
lastModifierUserId: null,
isDeleted: null,
deletionTime: null,
deleterUserId: null,
name: "",
status: null,
creator: "",
remark: "",
url: ""},
rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }]
}
}
},
props: {
v: Object,
eid: Number
},
mounted() {
if (this.eid > 0) {
this.load(this.eid);
}
},
methods: {
handleSubmit() {
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 = "document_template" + "." + 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:`${technologyUrl}documenttemplate/paged`,
paged(params){
return Api.post(`${technologyUrl}documenttemplate/paged`,params);
},
get(params){
return Api.get(`${technologyUrl}documenttemplate/get`,params);
},
create(params){
return Api.post(`${technologyUrl}documenttemplate/create`,params);
},
update(params){
return Api.post(`${technologyUrl}documenttemplate/update`,params);
},
delete(id) {
return Api.delete(`${technologyUrl}documenttemplate/delete`,{params:{id:id}});
},
deletes(params) {
return Api.post(`${technologyUrl}documenttemplate/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('name')">{{entity.name}}</Filed>
<Filed :span="12" :name="l('status')">{{entity.status}}</Filed>
<Filed :span="12" :name="l('creator')">{{entity.creator}}</Filed>
<Filed :span="12" :name="l('remark')">{{entity.remark}}</Filed>
<Filed :span="24" :name="l('url')">{{entity.url}}</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 = "document_template" + "." + 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('creationTime')" prop="creationTime"> <DatePicker type="date" v-model="entity.creationTime"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('creatorUserId')" prop="creatorUserId"> <InputNumber v-model="entity.creatorUserId"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('lastModificationTime')" prop="lastModificationTime"> <DatePicker type="date" v-model="entity.lastModificationTime"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId"> <InputNumber v-model="entity.lastModifierUserId"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('isDeleted')" prop="isDeleted"> <InputNumber v-model="entity.isDeleted"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('deletionTime')" prop="deletionTime"> <DatePicker type="date" v-model="entity.deletionTime"></DatePicker>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('deleterUserId')" prop="deleterUserId"> <InputNumber v-model="entity.deleterUserId"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('name')" prop="name"> <Input v-model="entity.name"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('status')" prop="status"> <InputNumber v-model="entity.status"></InputNumber>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('creator')" prop="creator"> <Input v-model="entity.creator"> </Input>
</FormItem></Col>
<Col :span="12"><FormItem :label="l('remark')" prop="remark"> <Input v-model="entity.remark"> </Input>
</FormItem></Col>
<Col :span="24"><FormItem :label="l('url')" prop="url"> <InputFile v-model="entity.url"></InputFile>
</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);
}
},
methods: {
load(v) {
Api.get({ id: v }).then(r => {
this.entity = r.result;
})
},
handleSubmit() {
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 = "document_template" + "." + 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: "document_template 9/16/2020 2:24:01 PM",
},
data() {
return {
action: Api.index,
easySearch: {
keys: { op: "name", 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: "name",
title: this.l("name"),
align: "left",
easy: true,
high: true,
},
{ key: "status", title: this.l("status"), align: "left", high: true },
{ key: "creator", title: this.l("creator"), align: "left", high: true },
{ key: "remark", title: this.l("remark"), align: "left", high: true },
{
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) {
/*
document_template:{
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'删除人',
deletionTime:'删除时间',
deleterUserId:'删除人',
name:'名称',
status:'状态',
creator:'创建人',
remark:'',
url:'模板路径',
}
*/
let vkey = "document_template" + "." + 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.creationTime.show"><FormItem :label="l('creationTime')" prop="creationTime"> <DatePicker type="daterange" v-model="condition.creationTime.value"></DatePicker>
</FormItem></Col>
<Col :span="12" :v-if="condition.creatorUserId.show"><FormItem :label="l('creatorUserId')" prop="creatorUserId"> <Input v-model="condition.creatorUserId.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.lastModificationTime.show"><FormItem :label="l('lastModificationTime')" prop="lastModificationTime"> <DatePicker type="daterange" v-model="condition.lastModificationTime.value"></DatePicker>
</FormItem></Col>
<Col :span="12" :v-if="condition.lastModifierUserId.show"><FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId"> <Input v-model="condition.lastModifierUserId.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.deletionTime.show"><FormItem :label="l('deletionTime')" prop="deletionTime"> <DatePicker type="daterange" v-model="condition.deletionTime.value"></DatePicker>
</FormItem></Col>
<Col :span="12" :v-if="condition.name.show"><FormItem :label="l('name')" prop="name"> <Input v-model="condition.name.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.status.show"><FormItem :label="l('status')" prop="status"> <Input v-model="condition.status.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.creator.show"><FormItem :label="l('creator')" prop="creator"> <Input v-model="condition.creator.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.remark.show"><FormItem :label="l('remark')" prop="remark"> <Input v-model="condition.remark.value"> </Input>
</FormItem></Col>
<Col :span="24" :v-if="condition.url.show"><FormItem :label="l('url')" prop="url"> <Input v-model="condition.url.value"> </Input>
</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},
name:{op:"Equal",value:null,show:true},
status:{op:"Equal",value:null,show:true},
creator:{op:"Equal",value:null,show:true},
remark:{op:"Equal",value:null,show:true},
url:{op:"Equal",value:null,show:true},
},
}
},
methods: {
handleClose() {
this.$emit('on-close')
},
l(key) {
key = "document_template" + "." + 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