|
|
|
@ -1,123 +1,42 @@
|
|
|
|
|
<template>
|
|
|
|
|
<template>
|
|
|
|
|
<div>
|
|
|
|
|
<!-- <a-card :bordered="false" :bodyStyle="tstyle">
|
|
|
|
|
<div class="table-page-search-wrapper" :class="advanced ? 'Open' : 'Close'">
|
|
|
|
|
<a-form layout="inline">
|
|
|
|
|
<a-row :gutter="48">
|
|
|
|
|
<a-col :md="18">
|
|
|
|
|
<a-row :gutter="48">
|
|
|
|
|
<a-col :md="8" :sm="24">
|
|
|
|
|
<a-form-item label="租户:">
|
|
|
|
|
<a-select v-model="queryParam.tenantId">
|
|
|
|
|
<a-select-option v-for="item in TenantData" :key="item.id" :value="item.id">
|
|
|
|
|
{{ item.name }}
|
|
|
|
|
</a-select-option>
|
|
|
|
|
</a-select>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :md="6" :sm="24">
|
|
|
|
|
<span class="table-page-search-submitButtons">
|
|
|
|
|
<a-button type="primary" @click="FnGetData">查询</a-button>
|
|
|
|
|
<a-button style="margin-left: 8px" @click="init">重置</a-button>
|
|
|
|
|
<a @click="toggleAdvanced" style="margin-left: 8px">
|
|
|
|
|
{{ advanced ? '收起' : '展开' }}
|
|
|
|
|
<a-icon :type="advanced ? 'up' : 'down'" />
|
|
|
|
|
</a>
|
|
|
|
|
</span>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
|
</a-form>
|
|
|
|
|
</div>
|
|
|
|
|
</a-card> -->
|
|
|
|
|
<a-card :bordered="false">
|
|
|
|
|
<vxe-toolbar>
|
|
|
|
|
<template #buttons>
|
|
|
|
|
<a-button type="primary" icon="plus" @click="$refs.addForm.add()">
|
|
|
|
|
新增配置
|
|
|
|
|
<a-row>
|
|
|
|
|
<a-col :span="3" :offset="21">
|
|
|
|
|
<a-button @click="handleSubmit" type="primary">
|
|
|
|
|
保存
|
|
|
|
|
</a-button>
|
|
|
|
|
</template>
|
|
|
|
|
</vxe-toolbar>
|
|
|
|
|
<vxe-table :data="loadData" border :loading="loading" height="670px" empty-text="没有更多数据了!">
|
|
|
|
|
<vxe-column type="seq" width="50" fixed="left"></vxe-column>
|
|
|
|
|
<!-- <vxe-column
|
|
|
|
|
v-for="item in columns"
|
|
|
|
|
:key="item.dataIndex"
|
|
|
|
|
:field="item.dataIndex"
|
|
|
|
|
:min-width="item.width"
|
|
|
|
|
:title="item.title"
|
|
|
|
|
:align="item.align"
|
|
|
|
|
:show-overflow="true"
|
|
|
|
|
>
|
|
|
|
|
</vxe-column> -->
|
|
|
|
|
<vxe-column title="租户" align="center" width="150">
|
|
|
|
|
<template #default="{ row }">
|
|
|
|
|
{{ FnRtenant(row.tenantId) }}
|
|
|
|
|
</template>
|
|
|
|
|
</vxe-column>
|
|
|
|
|
<vxe-column title="必填项" align="center">
|
|
|
|
|
<template #default="{ row }">
|
|
|
|
|
{{ FnRjson(row.configJson) }}
|
|
|
|
|
</template>
|
|
|
|
|
</vxe-column>
|
|
|
|
|
<vxe-column title="操作" fixed="right" width="200" align="center">
|
|
|
|
|
<template #default="{ row }">
|
|
|
|
|
<vxe-button type="text" @click="$refs.editForm.edit(row)">编辑</vxe-button>
|
|
|
|
|
<a-popconfirm title="是否确认删除?" ok-text="是" cancel-text="否" @confirm="confirm(row)">
|
|
|
|
|
<vxe-button type="text">删除</vxe-button>
|
|
|
|
|
</a-popconfirm>
|
|
|
|
|
</template>
|
|
|
|
|
</vxe-column>
|
|
|
|
|
</vxe-table>
|
|
|
|
|
<add-form ref="addForm" @ok="handleOk" />
|
|
|
|
|
<edit-form ref="editForm" @ok="handleOk" />
|
|
|
|
|
<a-button @click="FnGetData" type="primary" :style="{ marginLeft: '10px' }">
|
|
|
|
|
重置
|
|
|
|
|
</a-button>
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="24">
|
|
|
|
|
<a-checkbox-group v-model="WebData" :style="{ width: '100%', marginTop: '10px' }">
|
|
|
|
|
<a-row v-for="item in Data" :key="item.title">
|
|
|
|
|
<a-divider orientation="left">
|
|
|
|
|
{{ item.title }}
|
|
|
|
|
</a-divider>
|
|
|
|
|
<a-col :span="6" v-for="item2 in item.children" :key="item2.code">
|
|
|
|
|
<a-checkbox :value="item2.code">{{ item2.name }}</a-checkbox>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
|
</a-checkbox-group>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
|
</a-card>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
|
import { DjyTenantConfigPage, DjyTenantConfigDelete, SysTenantPage } from '@/api/modular/main/TenantConfig'
|
|
|
|
|
import addForm from './addForm.vue'
|
|
|
|
|
import editForm from './editForm.vue'
|
|
|
|
|
import { DjyTenantConfigGet, DjyTenantConfigEdit } from '@/api/modular/main/TenantConfig'
|
|
|
|
|
import Data from './Data.json'
|
|
|
|
|
export default {
|
|
|
|
|
components: {
|
|
|
|
|
addForm,
|
|
|
|
|
editForm
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
// 高级搜索 展开/关闭
|
|
|
|
|
advanced: false,
|
|
|
|
|
loading: false,
|
|
|
|
|
setVisible: false,
|
|
|
|
|
setVisible1: false,
|
|
|
|
|
Data,
|
|
|
|
|
WebData: [],
|
|
|
|
|
queryParam: {
|
|
|
|
|
Type: 'booking_form_col'
|
|
|
|
|
},
|
|
|
|
|
ColumnsQuery: [],
|
|
|
|
|
columns: [
|
|
|
|
|
{
|
|
|
|
|
title: '租户',
|
|
|
|
|
align: 'center',
|
|
|
|
|
dataIndex: 'tenantId'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '必填项',
|
|
|
|
|
align: 'center',
|
|
|
|
|
dataIndex: 'configJson'
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
tstyle: { 'padding-bottom': '0px', 'margin-bottom': '10px' },
|
|
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
|
|
loadData: [],
|
|
|
|
|
CodeData: [],
|
|
|
|
|
WCodeData: [],
|
|
|
|
|
ModulesData: [],
|
|
|
|
|
carrierCodeData: [],
|
|
|
|
|
UserList: [],
|
|
|
|
|
TenantData: [],
|
|
|
|
|
Data
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
created() {},
|
|
|
|
@ -125,79 +44,34 @@ export default {
|
|
|
|
|
this.init()
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
FnRtenant(id) {
|
|
|
|
|
let RData = '-'
|
|
|
|
|
this.TenantData.forEach(item => {
|
|
|
|
|
if (item.id == id) {
|
|
|
|
|
RData = item.name
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
return RData
|
|
|
|
|
},
|
|
|
|
|
FnRjson(data) {
|
|
|
|
|
let Rdata = ''
|
|
|
|
|
JSON.parse(data).forEach(item => {
|
|
|
|
|
console.log(item)
|
|
|
|
|
Data.forEach(ele => {
|
|
|
|
|
ele.children.forEach(e => {
|
|
|
|
|
if (item == e.code) {
|
|
|
|
|
Rdata ? (Rdata = `${Rdata},${e.name}`) : (Rdata = e.name)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
return Rdata
|
|
|
|
|
},
|
|
|
|
|
confirm(e) {
|
|
|
|
|
this.FnDel(e)
|
|
|
|
|
},
|
|
|
|
|
FnDel(data) {
|
|
|
|
|
DjyTenantConfigDelete({ id: data.id }).then(res => {
|
|
|
|
|
this.$message.success('删除成功')
|
|
|
|
|
this.FnGetData()
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
toggleAdvanced() {
|
|
|
|
|
this.advanced = !this.advanced
|
|
|
|
|
},
|
|
|
|
|
init() {
|
|
|
|
|
Object.assign(this.$data, this.$options.data())
|
|
|
|
|
this.ColumnsQuery = this.columns
|
|
|
|
|
this.FnGetData()
|
|
|
|
|
SysTenantPage().then(res => {
|
|
|
|
|
this.TenantData = res.data.rows
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
FnGetData() {
|
|
|
|
|
this.loading = true
|
|
|
|
|
DjyTenantConfigPage(this.queryParam).then(res => {
|
|
|
|
|
DjyTenantConfigGet(this.queryParam).then(res => {
|
|
|
|
|
if (res.code == 200) {
|
|
|
|
|
this.loadData = res.data.rows
|
|
|
|
|
this.WebData = JSON.parse(res.data.configJson)
|
|
|
|
|
this.id = res.data.id
|
|
|
|
|
} else {
|
|
|
|
|
this.loadData = []
|
|
|
|
|
this.WebData = []
|
|
|
|
|
this.$message.warning(res.message)
|
|
|
|
|
}
|
|
|
|
|
this.loading = false
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
handleOk() {
|
|
|
|
|
this.FnGetData()
|
|
|
|
|
handleSubmit() {
|
|
|
|
|
DjyTenantConfigEdit({ id: this.id, configJson: JSON.stringify(this.WebData), type: 'booking_form_col' }).then(
|
|
|
|
|
res => {
|
|
|
|
|
if (res.success) {
|
|
|
|
|
this.$message.success('保存成功')
|
|
|
|
|
this.FnGetData()
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(`保存失败,${res.message}`)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
<style lang="less">
|
|
|
|
|
.table-operator {
|
|
|
|
|
margin-bottom: 18px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
button {
|
|
|
|
|
margin-right: 8px;
|
|
|
|
|
}
|
|
|
|
|
.Open {
|
|
|
|
|
}
|
|
|
|
|
.Close {
|
|
|
|
|
height: 45px;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
<style lang="less"></style>
|
|
|
|
|