Commit db72294d authored by 周远喜's avatar 周远喜

ok

parent d0886e23
......@@ -223,8 +223,8 @@ export default {
return Api.delete(`${fileUrl}/delete/${id}`,)
},
//获取用户菜单
getusermenu() {
return Api.get(`${systemUrl}/menu/getusermenu`);
getusermenu(params) {
return Api.get(`${systemUrl}/menu/getusermenu`,params);
},
//获取全部菜单
getmarstermenu() {
......
......@@ -67,7 +67,7 @@ export default {
methods: {
getMenu() {
this.$http.sysUser.getusermenu().then(res => {
this.$http.sysUser.getusermenu({id:"portal"}).then(res => {
if (res.result) {
this.menus = res.result[0].children;
this.toMenu(this.menus);
......
<template>
<div>{{msg}}</div>
</template>
<script>
import Oidc from 'oidc-client'
var mgr = new Oidc.UserManager({ response_mode: 'query' })
export default {
name: 'CallBack',
layout: 'empty',
data() {
return {
msg: '授权登录成功,即将回到网站...'
}
},
beforeCreate() {
mgr.signinRedirectCallback()
.then(function() {
//console.log("callback...");
window.location = '/'
})
.catch(function(e) {})
}
}
</script>
<template>
<div id="gomap"></div>
</template>
<script>
import go from 'gojs'
const $ = go.GraphObject.make
export default {
layout: 'empty',
data() {
return {}
},
mounted() {
let map = $(go.Diagram, 'gomap', {
'undoManager.isEnabled': true // enable Ctrl-Z to undo and Ctrl-Y to redo
})
var myModel = $(go.Model)
map.nodeTemplate = $(
go.Node,
'Horizontal',
$(
go.Panel,
'Auto',
$(
go.TextBlock, //节点形状和背景颜色的设置
"hello",
new go.Binding('text','key')
),
{
click: function(e, node) {
// 双击事件
// handlerDC(e, node);//双击执行的方法
alert(node.part.key)
console.log(node)
}
}
)
)
myModel.nodeDataArray = [{ key: 'henq' }, { key: 'lily' }, { key: 'xinyi' }]
map.model = myModel
},
methods: {}
}
</script>
<style lang="less">
@basecolor: #249e91;
@endcolor: #d1dedc;
@fontColor: white;
#gomap {
canvas{
border:0;
outline:none;
}
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
}
</style>
\ No newline at end of file
This diff is collapsed.
import Api from '@/plugins/request'
export default {
index: `${PlanUrl}/mesorders/paged`,
paged(params) {
return Api.post(`${PlanUrl}/mesorders/paged`, params);
},
get(params) {
return Api.get(`${PlanUrl}/mesorders/get`, params);
},
create(params) {
return Api.post(`${PlanUrl}/mesorders/create`, params);
},
update(params) {
return Api.post(`${PlanUrl}/mesorders/update`, params);
},
//删除:
delete(params) {
return Api.delete(`${PlanUrl}/mesorders/delete`, {
params: params
});
},
}
\ No newline at end of file
<template>
<div class="detail">
<Row>
<Filed :span="12" :name="l('upId')">{{entity.upId}}</Filed>
<Filed :span="12" :name="l('mesCode')">{{entity.mesCode}}</Filed>
<Filed :span="12" :name="l('taskType')">{{entity.taskType}}</Filed>
<Filed :span="12" :name="l('productId')">{{entity.productId}}</Filed>
<Filed :span="12" :name="l('stage')">{{entity.stage}}</Filed>
<Filed :span="12" :name="l('materialId')">{{entity.materialId}}</Filed>
<Filed :span="12" :name="l('quantity')">{{entity.quantity}}</Filed>
<Filed :span="12" :name="l('guestName')">{{entity.guestName}}</Filed>
<Filed :span="12" :name="l('printSupply')">{{entity.printSupply}}</Filed>
<Filed :span="12" :name="l('functionaryOffice')">{{entity.functionaryOffice}}</Filed>
<Filed :span="12" :name="l('mainDepartmentId')">{{entity.mainDepartmentId}}</Filed>
<Filed :span="24" :name="l('remark')">{{entity.remark}}</Filed>
<Filed :span="12" :name="l('taskInputDate')">{{entity.taskInputDate}}</Filed>
<Filed :span="12" :name="l('taskRequire')">{{entity.taskRequire}}</Filed>
<Filed :span="12" :name="l('putintDocmentCode')">{{entity.putintDocmentCode}}</Filed>
<Filed :span="12" :name="l('technologyDocmentCode')">{{entity.technologyDocmentCode}}</Filed>
<Filed :span="12" :name="l('outerDrawnNumber')">{{entity.outerDrawnNumber}}</Filed>
<Filed :span="12" :name="l('modelVersion')">{{entity.modelVersion}}</Filed>
<Filed :span="12" :name="l('taskCode')">{{entity.taskCode}}</Filed>
<Filed :span="12" :name="l('designer')">{{entity.designer}}</Filed>
<Filed :span="12" :name="l('officeFunctionary')">{{entity.officeFunctionary}}</Filed>
<Filed :span="12" :name="l('mainRoutingPeople')">{{entity.mainRoutingPeople}}</Filed>
<Filed :span="12" :name="l('status')">{{entity.status}}</Filed>
<Filed :span="12" :name="l('workHours')">{{entity.workHours}}</Filed>
<Filed :span="12" :name="l('printPeriod')">{{entity.printPeriod}}</Filed>
<Filed :span="12" :name="l('equipment')">{{entity.equipment}}</Filed>
<Filed :span="12" :name="l('materialWeight')">{{entity.materialWeight}}</Filed>
<Filed :span="12" :name="l('isSupportingFinish')">{{entity.isSupportingFinish}}</Filed>
<Filed :span="12" :name="l('demandStartDate')">{{entity.demandStartDate}}</Filed>
<Filed :span="12" :name="l('demandFinishDate')">{{entity.demandFinishDate}}</Filed>
<Filed :span="12" :name="l('actualStartDate')">{{entity.actualStartDate}}</Filed>
<Filed :span="12" :name="l('actualFinishDate')">{{entity.actualFinishDate}}</Filed>
<Filed :span="12" :name="l('isDeleted')">{{entity.isDeleted}}</Filed>
<Filed :span="12" :name="l('creatorUserId')">{{entity.creatorUserId}}</Filed>
<Filed :span="12" :name="l('creationTime')">{{entity.creationTime}}</Filed>
<Filed :span="12" :name="l('lastModifierUserId')">{{entity.lastModifierUserId}}</Filed>
<Filed :span="12" :name="l('lastModificationTime')">{{entity.lastModificationTime}}</Filed>
<Filed :span="12" :name="l('orderQuotationStatus')">{{entity.orderQuotationStatus}}</Filed>
<Filed :span="12" :name="l('distributeMainRouting')">{{entity.distributeMainRouting}}</Filed>
<Filed :span="12" :name="l('mainRoutingFinishDate')">{{entity.mainRoutingFinishDate}}</Filed>
<Filed :span="12" :name="l('majorRoutingPeople')">{{entity.majorRoutingPeople}}</Filed>
<Filed :span="12" :name="l('majorRoutingFinishDate')">{{entity.majorRoutingFinishDate}}</Filed>
<Filed :span="12" :name="l('checkUpPeople')">{{entity.checkUpPeople}}</Filed>
<Filed :span="12" :name="l('checkUpFinishDate')">{{entity.checkUpFinishDate}}</Filed>
<Filed
:span="12"
:name="l('productingPreparationPeople')"
>{{entity.productingPreparationPeople}}</Filed>
<Filed
:span="12"
:name="l('productingPreparationFinishDate')"
>{{entity.productingPreparationFinishDate}}</Filed>
<Filed :span="12" :name="l('quotationPeople')">{{entity.quotationPeople}}</Filed>
<Filed :span="12" :name="l('quotationFinishDate')">{{entity.quotationFinishDate}}</Filed>
<Filed :span="12" :name="l('routingMethod')">{{entity.routingMethod}}</Filed>
<Filed :span="12" :name="l('outerEnvelopeSize')">{{entity.outerEnvelopeSize}}</Filed>
<Filed :span="12" :name="l('divideMark')">{{entity.divideMark}}</Filed>
<Filed :span="24" :name="l('productCode')">{{entity.productCode}}</Filed>
<Filed :span="12" :name="l('productName')">{{entity.productName}}</Filed>
<Filed :span="12" :name="l('drawnNumber')">{{entity.drawnNumber}}</Filed>
<Filed :span="12" :name="l('qualifiedQuantity')">{{entity.qualifiedQuantity}}</Filed>
<Filed :span="12" :name="l('uncertificateQuantity')">{{entity.uncertificateQuantity}}</Filed>
<Filed :span="12" :name="l('mainRoutingSetStatus')">{{entity.mainRoutingSetStatus}}</Filed>
<Filed :span="12" :name="l('majorRoutingSetStatus')">{{entity.majorRoutingSetStatus}}</Filed>
<Filed :span="12" :name="l('materialBillSetStatus')">{{entity.materialBillSetStatus}}</Filed>
<Filed :span="12" :name="l('routingDataSetStatus')">{{entity.routingDataSetStatus}}</Filed>
<Filed :span="12" :name="l('rootId')">{{entity.rootId}}</Filed>
<Filed :span="12" :name="l('mainRoutingExecuteStatus')">{{entity.mainRoutingExecuteStatus}}</Filed>
<Filed :span="12" :name="l('majorRoutingExecuteStatus')">{{entity.majorRoutingExecuteStatus}}</Filed>
<Filed
:span="12"
:name="l('mainRoutingActualStartDate')"
>{{entity.mainRoutingActualStartDate}}</Filed>
<Filed
:span="12"
:name="l('mainRoutingActualFinishDate')"
>{{entity.mainRoutingActualFinishDate}}</Filed>
<Filed
:span="12"
:name="l('majorRoutingActualStartDate')"
>{{entity.majorRoutingActualStartDate}}</Filed>
<Filed
:span="12"
:name="l('majorRoutingActualFinishDate')"
>{{entity.majorRoutingActualFinishDate}}</Filed>
<Filed :span="12" :name="l('batchNumber')">{{entity.batchNumber}}</Filed>
<Filed :span="12" :name="l('projectNumber')">{{entity.projectNumber}}</Filed>
<Filed :span="12" :name="l('urgencyLevel')">{{entity.urgencyLevel}}</Filed>
<Filed :span="12" :name="l('materialName')">{{entity.materialName}}</Filed>
<Filed :span="12" :name="l('isPreschedule')">{{entity.isPreschedule}}</Filed>
<Filed :span="12" :name="l('spareQty')">{{entity.spareQty}}</Filed>
<Filed :span="12" :name="l('demandStart')">{{entity.demandStart}}</Filed>
<Filed :span="12" :name="l('demandFinish')">{{entity.demandFinish}}</Filed>
<Filed :span="12" :name="l('partNamePro')">{{entity.partNamePro}}</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
},
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 = 'mes_order' + '.' + key
return this.$t(key)
}
},
watch: {
eid(v) {
if (v != 0) {
this.load(v)
}
}
}
}
</script>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="120">
<Row>
<Col :span="24">
<FormItem :label="l('name')" prop="name">
<Input v-model="entity.name"></Input>
</FormItem>
</Col>
</Row>
<Row>
<Col :span="24">
<FormItem :label="l('ip')" prop="ip">
<Input v-model="entity.ip"></Input>
</FormItem>
</Col>
</Row>
<Row>
<Col :span="24">
<FormItem :label="l('user')" prop="user">
<Input v-model="entity.user"></Input>
</FormItem>
</Col>
</Row>
<Row>
<Col :span="24">
<FormItem :label="l('password')" prop="password">
<Input v-model="entity.password"></Input>
</FormItem>
</Col>
</Row>
<Row>
<Col :span="24">
<FormItem :label="l('port')" prop="port">
<InputNumber v-model="entity.port"></InputNumber>
</FormItem>
</Col>
</Row>
<Row>
<FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Row>
</Form>
</template>
<script>
import Api from './api'
export default {
name: 'Add',
data() {
return {
disabled: false,
entity: {
name: '',
ip: '',
user: '',
password: '',
port: 22,
id: 0
},
rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }],
ip: [{ required: true, message: '必填', trigger: 'blur' }],
user: [{ required: true, message: '必填', trigger: 'blur' }],
password: [{ required: true, message: '必填', trigger: 'blur' }]
}
}
},
props: {
v: Object
},
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')
},
l(key) {
key = 'host' + '.' + key
return this.$t(key)
}
},
watch: {
v() {
this.entity = this.$u.clone(this.v)
}
}
}
</script>
\ No newline at end of file
import Api from '@/plugins/request'
export default {
index:`${authUrl}/api/services/app/host/paged`,
paged(params){
return Api.post(`${authUrl}/api/services/app/host/paged`,params);
},
get(params){
return Api.get(`${authUrl}/api/services/app/host/get`,params);
},
create(params){
return Api.post(`${authUrl}/api/services/app/host/create`,params);
},
update(params){
return Api.post(`${authUrl}/api/services/app/host/update`,params);
},
//删除:
delete(params) {
return Api.delete(`${authUrl}/api/services/app/host/delete`,{params:params});
},
}
\ No newline at end of file
<template>
<div class="detail">
<Row>
<Filed :span="24" :name="l('name')">{{entity.name}}</Filed>
<Filed :span="24" :name="l('ip')">{{entity.ip}}</Filed>
<Filed :span="24" :name="l('user')">{{entity.user}}</Filed>
<Filed :span="24" :name="l('password')">{{entity.password}}</Filed>
<Filed :span="24" :name="l('port')">{{entity.port}}</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
},
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 = "host" + "." + 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="120">
<Row>
<Col :span="24">
<FormItem :label="l('name')" prop="name">
<Input v-model="entity.name"></Input>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('ip')" prop="ip">
<Input v-model="entity.ip"></Input>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('user')" prop="user">
<Input v-model="entity.user"></Input>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('password')" prop="password">
<Input v-model="entity.password"></Input>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('port')" prop="port">
<InputNumber v-model="entity.port"></InputNumber>
</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: { name: '', ip: '', user: '', password: '', port: 22, id: 0 },
rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }],
ip: [{ required: true, message: '必填', trigger: 'blur' }],
user: [{ required: true, message: '必填', trigger: 'blur' }],
password: [{ required: true, message: '必填', trigger: 'blur' }]
}
}
},
props: {
eid: Number
},
methods: {
load(v) {
Api.get({ id: v }).then((r) => {
this.entity = r.result
this.$emit('on-load')
})
},
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 = 'host' + '.' + 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="请输入数据源/服务器/用户" class="w200" 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="addModal=true">新增</Button>
</template>
</DataGrid>
<Modal v-model="addModal" width="720px" title="新增" footer-hide>
<Add @on-close="cancel" @on-ok="addOk" />
</Modal>
<Modal v-model="editModal" width="720px" title="编辑" footer-hide>
<Edit :eid="curId" @on-close="cancel" @on-ok="addOk" />
</Modal>
<Modal v-model="detailModal" width="720px" title="详情">
<Detail :eid="curId" />
</Modal>
<Modal v-model="deletelModal" title="删除" @on-ok="removeOk"
@on-cancel="cancel">
<p>确定删除?</p>
</Modal>
</div>
</template>
<script>
import Api from './api'
import Add from './add'
import Edit from './edit'
import Detail from './detail'
import Search from './search'
export default {
name: 'list',
components:{
Add,Edit,Detail,Search
},
data() {
return {
action: Api.index,
easySearch: {
keys:{op:"name,ip,user",value:null}
},
addModal: false,
editModal: false,
detailModal: false,
deletelModal: false,
curId: 0,
columns: [
{ key:"id",title:this.l("id") ,hide:true ,align:"left" },
{ key:"name",title:this.l("name") ,align:"left" ,easy:true ,high:true },
{ key:"ip",title:this.l("ip") ,align:"left" ,easy:true ,high:true },
{ key:"user",title:this.l("user") ,align:"left" ,easy:true ,high:true },
{ key:"password",title:this.l("password") ,align:"left" },
{ key:"port",title:this.l("port") ,align:"left" ,high:true },
{ key:"creationTime",title:this.l("creationTime") ,hide:true ,align:"left" },
{ key:"creatorUserId",title:this.l("creatorUserId") ,hide:true ,align:"left" },
{ key:"lastModificationTime",title:this.l("lastModificationTime") ,hide:true ,align:"left" },
{ key:"lastModifierUserId",title:this.l("lastModifierUserId") ,hide:true ,align:"left" },
{ key:"isDeleted",title:this.l("isDeleted") ,hide:true ,align:"left" },
{ key:"deletionTime",title:this.l("deletionTime") ,hide:true ,align:"left" },
{ key:"deleterUserId",title:this.l("deleterUserId") ,hide:true ,align:"left" },
{
title: '操作',
key: 'id',
width: 140,
align: 'center',
render: (h, params) => {
return h('div', { class: "action" }, [
h('op', { attrs: { oprate: 'detail' }, on: { click: () => this.detail(params.row.id) } }, '查看'),
h('op', { attrs: { oprate: 'edit'}, on: { click: () => this.edit(params.row.id) } }, '编辑'),
h('op', { attrs: { oprate: 'remove' }, on: { click: () => this.remove(params.row.id) } }, '删除')
])
}
},
]
}
},
mounted(){
this.$refs.grid.load()
},
async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典
},
methods:{
addOk() {
this.$refs.grid.load()
this.addModal = false
this.detailModal = false
this.editModal = false;
this.curId = 0;
},
search() {
this.$refs.grid.reload(this.easySearch)
},
detail(id) {
this.detailModal = true;
this.curId = id;
},
edit(id) {
this.editModal = true;
this.curId = id;
},
remove(id) {
this.deletelModal = true;
this.curId = id;
},
removeOk() {
Api.delete({ id: this.curId }).then((r) => {
if (r.success) {
this.$refs.grid.load();
this.deletelModal = false;
this.$Message.success('删除成功')
}
})
},
removeCancel() {
this.deletelModal = false;
},
cancel() {
this.curId = 0;
this.addModal = false
this.detailModal = false
this.editModal = false;
this.deletedlModal = false;
},
l(key) {
/*
host:{
id:'',
name:'数据源名称',
ip:'服务器地址',
user:'用户名',
password:'密码',
port:'ssh端口',
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'是否删除',
deletionTime:'删除时间',
deleterUserId:'删除人',
}
*/
let vkey = "host" + "." + 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="24" :v-if="condition.id.show"><FormItem :label="l('id')" prop="id"> <Input v-model="condition.id.value"> </Input>
</FormItem></Col>
<Col :span="24" :v-if="condition.name.show"><FormItem :label="l('name')" prop="name"> <Input v-model="condition.name.value"> </Input>
</FormItem></Col>
<Col :span="24" :v-if="condition.ip.show"><FormItem :label="l('ip')" prop="ip"> <Input v-model="condition.ip.value"> </Input>
</FormItem></Col>
<Col :span="24" :v-if="condition.user.show"><FormItem :label="l('user')" prop="user"> <Input v-model="condition.user.value"> </Input>
</FormItem></Col>
<Col :span="24" :v-if="condition.password.show"><FormItem :label="l('password')" prop="password"> <Input v-model="condition.password.value"> </Input>
</FormItem></Col>
<Col :span="24" :v-if="condition.port.show"><FormItem :label="l('port')" prop="port"> <Input v-model="condition.port.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.isDeleted.show"><FormItem :label="l('isDeleted')" prop="isDeleted"> <Input v-model="condition.isDeleted.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.deleterUserId.show"><FormItem :label="l('deleterUserId')" prop="deleterUserId"> <Input v-model="condition.deleterUserId.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:false},
name:{op:"Equal",value:null,show:true},
ip:{op:"Equal",value:null,show:true},
user:{op:"Equal",value:null,show:true},
password:{op:"Equal",value:null,show:false},
port:{op:"Equal",value:null,show:true},
creationTime:{op:"Range",value:null,show:false},
creatorUserId:{op:"Equal",value:null,show:false},
lastModificationTime:{op:"Range",value:null,show:false},
lastModifierUserId:{op:"Equal",value:null,show:false},
isDeleted:{op:"Equal",value:null,show:false},
deletionTime:{op:"Range",value:null,show:false},
deleterUserId:{op:"Equal",value:null,show:false},
},
}
},
methods: {
handleClose() {
this.$emit('on-close')
},
l(key) {
key = "host" + "." + key;
return this.$t(key)
}
}
}
</script>
\ No newline at end of file
<template>
<Form ref="form" :model="entity" :rules="rules" :label-width="120">
<Row>
<Col :span="24">
<FormItem :label="l('name')" prop="name">
<Input v-model="entity.name"></Input>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('code')" prop="code">
<Input v-model="entity.code"></Input>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('typeId')" prop="typeId">
<Dictionary code="system.Tanant.type" v-model="entity.typeId" type="select"></Dictionary>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('startTime')" prop="startTime">
<DatePicker type="date" v-model="entity.startTime"></DatePicker>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('endTime')" prop="endTime">
<DatePicker type="date" v-model="entity.endTime"></DatePicker>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('hostId')" prop="hostId">
<Select @on-change="onchange_host" v-model="entity.hostId">
<Option v-for="(item,index) in hostlist" :key="index" :value="item.id">{{item.name}}</Option>
</Select>
</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: {
id: 0,
name: '',
code: '',
typeId: 0,
startTime: '',
endTime: '',
initialized: 0,
dataSourceId: 0,
hostId: '0',
},
hostlist: [],
rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }],
code: [{ required: true, message: '必填', trigger: 'blur' }]
}
}
},
props: {
v: Object
},
mounted() {
Api.bindhostlist()
.then((r) => {
if (r.success) {
this.hostlist = r.result
} else {
}
})
.catch((err) => {
console.warn(err)
})
},
methods: {
handleSubmit() {
console.log(this.entity.hostId)
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)
})
}
})
},
onchange_host(val) {
this.entity.hostId = val
},
handleClose() {
this.$emit('on-close')
},
l(key) {
key = 'tanant' + '.' + key
return this.$t(key)
}
},
watch: {
v() {
this.entity = this.$u.clone(this.v)
}
}
}
</script>
\ No newline at end of file
import Api from '@/plugins/request'
export default {
index: `${authUrl}/api/services/app/tanant/paged`,
paged(params) {
return Api.post(`${authUrl}/api/services/app/tanant/paged`, params);
},
get(params) {
return Api.get(`${authUrl}/api/services/app/tanant/get`, params);
},
create(params) {
return Api.post(`${authUrl}/api/services/app/tanant/create`, params);
},
update(params) {
return Api.post(`${authUrl}/api/services/app/tanant/update`, params);
},
//删除:
delete(params) {
return Api.delete(`${authUrl}/api/services/app/tanant/delete`, { params: params });
},
bindhostlist() {
return Api.post(`${authUrl}/api/services/app/host/list`, {});
},
tanantinit(params) {
return Api.post(`${authUrl}/api/services/app/tanant/tanantinit`,params );
},
}
\ No newline at end of file
<template>
<div class="detail">
<Row>
<Filed :span="24" :label-width="120" :name="l('name')">{{entity.name}}</Filed>
<Filed :span="24" :label-width="120" :name="l('code')">{{entity.code}}</Filed>
<Filed :span="24" :label-width="120" :name="l('typeId')">{{entity.typeId}}</Filed>
<Filed :span="24" :label-width="120" :name="l('startTime')">{{entity.startTime}}</Filed>
<Filed :span="24" :label-width="120" :name="l('endTime')">{{entity.endTime}}</Filed>
<!-- <Filed :span="24" :name="l('initialized')">{{entity.initialized}}</Filed>
<Filed :span="24" :name="l('hostId')">{{entity.hostId}}</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
},
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 = 'tanant' + '.' + 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="24">
<FormItem :label="l('name')" prop="name">
<Input v-model="entity.name"></Input>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('code')" prop="code">
<Input v-model="entity.code"></Input>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('typeId')" prop="typeId">
<Dictionary code="system.Tanant.type" v-model="entity.typeId" type="select"></Dictionary>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('startTime')" prop="startTime">
<DatePicker type="date" v-model="entity.startTime"></DatePicker>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('endTime')" prop="endTime">
<DatePicker type="date" v-model="entity.endTime"></DatePicker>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('hostId')" prop="hostId">
<Select @on-change="onchange_host" v-model="entity.hostId">
<Option v-for="(item,index) in hostlist" :key="index" :value="item.id">{{item.name}}</Option>
</Select>
</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: {
id: 0,
name: '',
code: '',
typeId: 0,
startTime: '',
endTime: '',
initialized: 0,
dataSourceId: 0,
hostId: 0
},
hostlist: [],
rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }],
code: [{ required: true, message: '必填', trigger: 'blur' }]
// hostId: [{ required: true, message: '必填', trigger: 'blur' }]
}
}
},
props: {
eid: Number
},
mounted() {
Api.bindhostlist()
.then((r) => {
if (r.success) {
this.hostlist = r.result
} else {
}
})
.catch((err) => {
console.warn(err)
})
},
methods: {
load(v) {
Api.get({ id: v }).then((r) => {
this.entity = r.result
this.$emit('on-load')
})
},
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)
})
}
})
},
onchange_host(val) {
this.entity.hostId = val
},
handleClose() {
this.$emit('on-close')
},
l(key) {
key = 'tanant' + '.' + 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" class="w200"/>
</FormItem>
<FormItem>
<Button type="primary" @click="search">查询</Button>
</FormItem>
</Form>
</template>
<template slot="searchForm">
<Search />
</template>
<template slot="buttons">
<Button type="primary" @click="addModal=true">新增</Button>
</template>
</DataGrid>
<Modal v-model="addModal" title="新增" footer-hide>
<Add @on-close="cancel" @on-ok="addOk" />
</Modal>
<Modal v-model="editModal" title="编辑" footer-hide>
<Edit :eid="curId" @on-close="cancel" @on-ok="addOk" />
</Modal>
<Modal v-model="detailModal" title="详情">
<Detail :eid="curId" />
</Modal>
<Modal v-model="datadetailModal" title="数据源详情">
<dataDetail :eid="datacurId" />
</Modal>
<Modal v-model="deletelModal" title="删除" @on-ok="removeOk" @on-cancel="cancel">
<p>确定删除?</p>
</Modal>
</div>
</template>
<script>
import Api from './api'
import Add from './add'
import Edit from './edit'
import Detail from './detail'
import Search from './search'
import dataDetail from '../data_source/detail'
export default {
name: 'list',
components: {
Add,
Edit,
Detail,
Search,
dataDetail
},
data() {
return {
action: Api.index,
easySearch: {
keys: { op: 'name,code', value: null }
},
addModal: false,
editModal: false,
detailModal: false,
deletelModal: false,
datadetailModal: false,
curId: 0,
datacurId: 0,
columns: [
{ key: 'id', title: this.l('id'), hide: true, align: 'left' },
{
key: 'name',
title: this.l('name'),
align: 'left',
easy: true,
high: true
},
{
key: 'code',
title: this.l('code'),
align: 'left',
easy: true,
high: true
},
{
key: 'typeId',
title: this.l('typeId'),
align: 'left',
high: true,
code: 'system.Tanant.type'
},
{
key: 'startTime',
title: this.l('startTime'),
align: 'left',
high: true
},
{ key: 'endTime', title: this.l('endTime'), align: 'left', high: true },
{
key: 'initialized',
title: this.l('initialized'),
align: 'left',
high: true,
code: 'system.Tanant.init'
},
{
key: 'hostTitle',
title: this.l('hostId'),
align: 'left',
high: true
},
{
key: 'dataSourceTitle',
title: this.l('dataSourceId'),
align: 'left',
render: (h, params) => {
if (params.row.dataSourceId == 0) {
return ''
}
return h('div', { class: 'action' }, [
h(
'op',
{
attrs: { oprate: 'detail' },
on: {
click: () => this.datadetail(params.row.dataSourceId)
}
},
params.row.dataSourceTitle
)
])
}
},
{
key: 'creationTime',
title: this.l('creationTime'),
hide: true,
align: 'left'
},
{
key: 'creatorUserId',
title: this.l('creatorUserId'),
hide: true,
align: 'left'
},
{
key: 'lastModificationTime',
title: this.l('lastModificationTime'),
hide: true,
align: 'left'
},
{
key: 'lastModifierUserId',
title: this.l('lastModifierUserId'),
hide: true,
align: 'left'
},
{
key: 'isDeleted',
title: this.l('isDeleted'),
hide: true,
align: 'left'
},
{
key: 'deletionTime',
title: this.l('deletionTime'),
hide: true,
align: 'left'
},
{
key: 'deleterUserId',
title: this.l('deleterUserId'),
hide: true,
align: 'left'
},
{
title: '操作',
key: 'id',
width: 180,
align: 'center',
render: (h, params) => {
if (params.row.initialized == 1) {
return h('div', { class: 'action' }, [
h(
'op',
{
attrs: { oprate: 'detail' },
on: { click: () => this.detail(params.row.id) }
},
'查看'
)
])
} else {
return h('div', { class: 'action' }, [
h(
'op',
{
attrs: { oprate: 'detail' },
on: { click: () => this.detail(params.row.id) }
},
'查看'
),
h(
'op',
{
attrs: { oprate: 'edit' },
on: { click: () => this.edit(params.row.id) }
},
'编辑'
),
h(
'op',
{
attrs: { oprate: 'edit' },
on: { click: () => this.TanantInit(params.row) }
},
'初始化'
),
h(
'op',
{
attrs: { oprate: 'remove' },
on: { click: () => this.remove(params.row.id) }
},
'删除'
)
])
}
}
}
]
}
},
mounted() {
this.$refs.grid.load()
},
async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典
},
methods: {
addOk() {
this.$refs.grid.load()
this.addModal = false
this.detailModal = false
this.editModal = false
this.curId = 0
},
search() {
this.$refs.grid.reload(this.easySearch)
},
detail(id) {
this.detailModal = true
this.curId = id
},
datadetail(id) {
this.datadetailModal = true
this.datacurId = id
},
edit(id) {
this.editModal = true
this.curId = id
},
TanantInit(rowdata) {
let obj = {
id: rowdata.id,
hostId: rowdata.hostId
}
Api.tanantinit(obj)
.then((r) => {
if (r.success) {
this.$refs.grid.load()
this.$Message.success('初始化成功')
} else {
this.$Message.error('初始化失败')
}
})
.catch((err) => {
console.warn(err)
})
},
remove(id) {
this.deletelModal = true
this.curId = id
},
removeOk() {
Api.delete({ id: this.curId }).then((r) => {
if (r.success) {
this.$refs.grid.load()
this.deletelModal = false
this.$Message.success('删除成功')
}
})
},
removeCancel() {
this.deletelModal = false
},
cancel() {
this.curId = 0
this.addModal = false
this.detailModal = false
this.editModal = false
this.deletedlModal = false
},
l(key) {
/*
tanant:{
id:'',
name:'公司名称',
code:'公司编码',
typeId:'公司类型',
startTime:'服务开始时间',
endTime:'服务结束时间',
initialized:'是否已初始化',
dataSourceId:'数据源ID',
creationTime:'创建时间',
creatorUserId:'创建人',
lastModificationTime:'更新时间',
lastModifierUserId:'更新人',
isDeleted:'是否删除',
deletionTime:'删除时间',
deleterUserId:'删除人',
hostId:'服务器ID',
}
*/
let vkey = 'tanant' + '.' + 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="l('id')" prop="id"> <Input v-model="condition.id.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>
<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.typeId.show"><FormItem :label="l('typeId')" prop="typeId"> <Input v-model="condition.typeId.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.startTime.show"><FormItem :label="l('startTime')" prop="startTime"> <DatePicker type="daterange" v-model="condition.startTime.value"></DatePicker>
</FormItem></Col>
<Col :span="12" :v-if="condition.endTime.show"><FormItem :label="l('endTime')" prop="endTime"> <DatePicker type="daterange" v-model="condition.endTime.value"></DatePicker>
</FormItem></Col>
<Col :span="12" :v-if="condition.initialized.show"><FormItem :label="l('initialized')" prop="initialized"> <Dictionary code="system.tanant.initialized" v-model="condition.initialized.value"></Dictionary>
</FormItem></Col>
<Col :span="12" :v-if="condition.dataSourceId.show"><FormItem :label="l('dataSourceId')" prop="dataSourceId"> <Input v-model="condition.dataSourceId.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.isDeleted.show"><FormItem :label="l('isDeleted')" prop="isDeleted"> <Input v-model="condition.isDeleted.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.deleterUserId.show"><FormItem :label="l('deleterUserId')" prop="deleterUserId"> <Input v-model="condition.deleterUserId.value"> </Input>
</FormItem></Col>
<Col :span="12" :v-if="condition.hostId.show"><FormItem :label="l('hostId')" prop="hostId"> <Input v-model="condition.hostId.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:false},
name:{op:"Equal",value:null,show:true},
code:{op:"Equal",value:null,show:true},
typeId:{op:"Equal",value:null,show:true},
startTime:{op:"Range",value:null,show:true},
endTime:{op:"Range",value:null,show:true},
initialized:{op:"Equal",value:null,show:true},
dataSourceId:{op:"Equal",value:null,show:false},
creationTime:{op:"Range",value:null,show:false},
creatorUserId:{op:"Equal",value:null,show:false},
lastModificationTime:{op:"Range",value:null,show:false},
lastModifierUserId:{op:"Equal",value:null,show:false},
isDeleted:{op:"Equal",value:null,show:false},
deletionTime:{op:"Range",value:null,show:false},
deleterUserId:{op:"Equal",value:null,show:false},
hostId:{op:"Equal",value:null,show:true},
},
}
},
methods: {
handleClose() {
this.$emit('on-close')
},
l(key) {
key = "tanant" + "." + 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