fix: 修复完善了字典表的新增,删除,和字典表数据的新增,修改,以及在资产数据字典的展示
parent
723edee74f
commit
e90fa588c7
|
@ -0,0 +1,44 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询【请填写功能名称】列表
|
||||
export function listAccredit(query) {
|
||||
return request({
|
||||
url: '/etl/assetAccredit/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询【请填写功能名称】详细
|
||||
export function getAccredit(id) {
|
||||
return request({
|
||||
url: '/etl/assetAccredit/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增【请填写功能名称】
|
||||
export function addAccredit(data) {
|
||||
return request({
|
||||
url: '/etl/assetAccredit',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改【请填写功能名称】
|
||||
export function updateAccredit(data) {
|
||||
return request({
|
||||
url: '/etl/assetAccredit',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除【请填写功能名称】
|
||||
export function delAccredit(id) {
|
||||
return request({
|
||||
url: '/etl/assetAccredit/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
|
@ -91,6 +91,15 @@ export function updateSource(data) {
|
|||
})
|
||||
}
|
||||
|
||||
// 修改字段数据
|
||||
export function updateAssetModel(data) {
|
||||
return request({
|
||||
url: '/etl/model/UpdateAssetModel',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除【请填写功能名称】
|
||||
export function delSource(id) {
|
||||
return request({
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询【请填写功能名称】列表
|
||||
export function listAccredit(query) {
|
||||
return request({
|
||||
url: '/etl/sourceAccredit/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询【请填写功能名称】详细
|
||||
export function getAccredit(id) {
|
||||
return request({
|
||||
url: '/etl/sourceAccredit/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增【请填写功能名称】
|
||||
export function addAccredit(data) {
|
||||
return request({
|
||||
url: '/etl/sourceAccredit',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改【请填写功能名称】
|
||||
export function updateAccredit(data) {
|
||||
return request({
|
||||
url: '/etl/sourceAccredit',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除【请填写功能名称】
|
||||
export function delAccredit(id) {
|
||||
return request({
|
||||
url: '/etl/sourceAccredit/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
|
@ -84,6 +84,8 @@
|
|||
<script>
|
||||
|
||||
import { parseTime } from '@/utils/muyu'
|
||||
import {listDept} from "@/api/system/dept";
|
||||
import {listUser} from "@/api/system/user";
|
||||
|
||||
export default {
|
||||
props:{
|
||||
|
@ -95,10 +97,12 @@ export default {
|
|||
// 遮罩层
|
||||
loading: true,
|
||||
activeName: "dept",
|
||||
// 分页信息
|
||||
total: 0,
|
||||
pageNum: 1,
|
||||
pageSize: 1,
|
||||
// 用户查询参数
|
||||
userQueryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
total: 0
|
||||
},
|
||||
// 基本信息
|
||||
baseInfo: {
|
||||
name: "测试1",
|
||||
|
@ -114,10 +118,28 @@ export default {
|
|||
created() {
|
||||
this.loading = true;
|
||||
setTimeout(() => this.loading = false, 200)
|
||||
this.init()
|
||||
this.getList()
|
||||
this.getUserList()
|
||||
},
|
||||
methods: {
|
||||
parseTime,
|
||||
/** 查询部门列表 */
|
||||
getList() {
|
||||
listDept(this.queryParams).then(response => {
|
||||
console.log(response.data)
|
||||
this.deptList = this.handleTree(response.data, "deptId");
|
||||
console.log(this.deptList)
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 查询用户列表 */
|
||||
getUserList() {
|
||||
listUser(this.addDateRange(this.userQueryParams, [])).then(response => {
|
||||
this.userList = response.data.rows;
|
||||
this.userQueryParams.total = response.data.total;
|
||||
}
|
||||
);
|
||||
},
|
||||
init(){
|
||||
let response = {
|
||||
"code": 200,
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
<el-table
|
||||
v-loading="loading"
|
||||
:data="deptList"
|
||||
:default-expand-all="isExpandAll"
|
||||
:default-expand-all="true"
|
||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
||||
row-key="deptId"
|
||||
>
|
||||
|
@ -67,7 +67,6 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination v-show="total> 0" :limit.sync="pageSize" :page.sync="pageNum" :total="total"/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="用户授权" name="user">
|
||||
<el-table ref="table" v-loading="loading" :data="userList">
|
||||
|
@ -90,7 +89,7 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination v-show="total> 0" :limit.sync="pageSize" :page.sync="pageNum" :total="total"/>
|
||||
<pagination v-show="userQueryParams.total> 0" :limit.sync="userQueryParams.pageSize" :page.sync="userQueryParams.pageNum" :total="userQueryParams.total"/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
|
@ -100,6 +99,7 @@
|
|||
|
||||
import { parseTime } from '@/utils/muyu'
|
||||
import {listDept} from "@/api/system/dept";
|
||||
import {listUser} from "@/api/system/user";
|
||||
|
||||
export default {
|
||||
props:{
|
||||
|
@ -113,9 +113,12 @@ export default {
|
|||
loading: true,
|
||||
activeName: "dept",
|
||||
// 分页信息
|
||||
total: 0,
|
||||
pageNum: 1,
|
||||
pageSize: 1,
|
||||
// 用户查询参数
|
||||
userQueryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
total: 0
|
||||
},
|
||||
// 部门列表
|
||||
deptList: [],
|
||||
// 用户列表
|
||||
|
@ -126,6 +129,7 @@ export default {
|
|||
this.loading = true;
|
||||
setTimeout(() => this.loading = false, 200)
|
||||
this.getList()
|
||||
this.getUserList()
|
||||
},
|
||||
methods: {
|
||||
/** 查询部门列表 */
|
||||
|
@ -137,6 +141,14 @@ export default {
|
|||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 查询用户列表 */
|
||||
getUserList() {
|
||||
listUser(this.addDateRange(this.userQueryParams, [])).then(response => {
|
||||
this.userList = response.data.rows;
|
||||
this.userQueryParams.total = response.data.total;
|
||||
}
|
||||
);
|
||||
},
|
||||
parseTime,
|
||||
init(){
|
||||
// this.deptList = this.handleTree(response.data, "deptId");
|
||||
|
|
|
@ -55,13 +55,9 @@
|
|||
placement="left"
|
||||
width="200"
|
||||
trigger="hover">
|
||||
<el-table :data="[
|
||||
{ label: '男', value: '1' },
|
||||
{ label: '女', value: '2' },
|
||||
{ label: '未知', value: '0' },
|
||||
]">
|
||||
<el-table :data="scope.row.dictionaryDatas">
|
||||
<el-table-column property="label" label="字典标签"/>
|
||||
<el-table-column property="value" label="字典值"/>
|
||||
<el-table-column property="val" label="字典值"/>
|
||||
</el-table>
|
||||
<el-tag slot="reference">{{scope.row.dictKey}}</el-tag>
|
||||
</el-popover>
|
||||
|
@ -166,13 +162,13 @@
|
|||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="formStatus = false">取 消</el-button>
|
||||
<el-button type="primary" @click="formStatus = false">确 定</el-button>
|
||||
<el-button type="primary" @click="updDict()">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {assetModelList} from "@/api/etl/source";
|
||||
import {assetModelList, updateAssetModel, updateSource} from "@/api/etl/source";
|
||||
import {getDictionaryList} from "@/api/etl/dictionary";
|
||||
|
||||
export default {
|
||||
|
@ -181,9 +177,7 @@ export default {
|
|||
'title': {
|
||||
handler(val) {
|
||||
this.getDictionaryList()
|
||||
assetModelList(val).then(res => {
|
||||
this.tableData = res.data
|
||||
})
|
||||
this.assetModelList()
|
||||
},
|
||||
immediate: true
|
||||
},
|
||||
|
@ -192,6 +186,7 @@ export default {
|
|||
this.dictMap.forEach(dict => {
|
||||
if (dict.dictionaryKey === val){
|
||||
this.dictionaryDataList = dict.dictionaryDataList
|
||||
this.form.dictionaryId = dict.id
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -210,13 +205,32 @@ export default {
|
|||
dictMap: {}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
assetModelList(){
|
||||
assetModelList(this.title).then(res => {
|
||||
this.tableData = res.data
|
||||
this.formStatus = false
|
||||
console.log(this.tableData)
|
||||
})
|
||||
},
|
||||
updDict(){
|
||||
console.log(this.form)
|
||||
updateAssetModel(this.form).then(res => {
|
||||
this.assetModelList()
|
||||
})
|
||||
|
||||
|
||||
},
|
||||
getDictionaryList() {
|
||||
getDictionaryList(this.title.dataSourceId).then(res => {
|
||||
this.dictMap = res.data
|
||||
console.log(this.dictMap)
|
||||
})
|
||||
},
|
||||
update(row) {
|
||||
async update(row) {
|
||||
await this.getDictionaryList()
|
||||
this.form = row;
|
||||
this.formStatus = true;
|
||||
}
|
||||
|
|
|
@ -116,7 +116,7 @@
|
|||
<el-col :span="24">
|
||||
<el-tabs v-model="activeName" type="border-card">
|
||||
<el-tab-pane v-for="tableAsset in title.tableList" :label="tableAsset.tableName+'('+tableAsset.tableComment+')'" :name="tableAsset.tableName">
|
||||
<overall-asset-structure v-if="activeName == tableAsset.tableName" :title="tableAsset"/>
|
||||
<overall-asset-structure ref="assetStru" v-if="activeName == tableAsset.tableName" :title="tableAsset"/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-col>
|
||||
|
@ -172,13 +172,17 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
deleteDictionary(id) {
|
||||
deleteDictionary(id);
|
||||
this.getDictionaryList()
|
||||
deleteDictionary(id).then(res => {
|
||||
this.getDictionaryList()
|
||||
// this.$nextTick(() => {
|
||||
// this.$refs.assetStru.assetModelList()
|
||||
// })
|
||||
})
|
||||
|
||||
},
|
||||
getDictionaryList() {
|
||||
getDictionaryList(this.title.id).then(res => {
|
||||
this.dictMap = res.data
|
||||
console.log(this.dictMap)
|
||||
})
|
||||
},
|
||||
editConfirm(dict,row){
|
||||
|
@ -189,14 +193,25 @@ export default {
|
|||
console.log(row)
|
||||
if (row.id) {
|
||||
console.log('修改')
|
||||
updateData(row)
|
||||
updateData(row).then(res => {
|
||||
row.edit = false;
|
||||
this.getDictionaryList()
|
||||
// this.$nextTick(() => {
|
||||
// this.$refs.assetStru.assetModelList()
|
||||
// })
|
||||
})
|
||||
}else{
|
||||
console.log('添加')
|
||||
row.dictionaryId=dict.id
|
||||
addData(row)
|
||||
addData(row).then(res => {
|
||||
row.edit = false;
|
||||
this.getDictionaryList()
|
||||
// this.$nextTick(() => {
|
||||
// this.$refs.assetStru.assetModelList()
|
||||
// })
|
||||
})
|
||||
}
|
||||
row.edit = false;
|
||||
this.getDictionaryList()
|
||||
|
||||
},
|
||||
addDict(){
|
||||
if (!this.dictInfo.dictionaryName){
|
||||
|
@ -208,13 +223,15 @@ export default {
|
|||
return;
|
||||
}
|
||||
this.dictInfo.dataSourceId = this.title.id
|
||||
addDictionary(this.dictInfo)
|
||||
this.dictInfo = {
|
||||
dictionaryName: null,
|
||||
dictionaryKey: null,
|
||||
dataSourceId: null
|
||||
}
|
||||
this.getDictionaryList()
|
||||
addDictionary(this.dictInfo).then(res => {
|
||||
this.dictInfo = {
|
||||
dictionaryName: null,
|
||||
dictionaryKey: null,
|
||||
dataSourceId: null
|
||||
}
|
||||
this.getDictionaryList()
|
||||
})
|
||||
|
||||
},
|
||||
handleSetLineChartData(type) {
|
||||
this.$emit('handleSetLineChartData', type)
|
||||
|
|
|
@ -139,7 +139,7 @@ export default {
|
|||
})
|
||||
},
|
||||
getList() {
|
||||
listSource(this.queryParams).then(response => {
|
||||
listSource({}).then(response => {
|
||||
this.sourceList = response.data.rows;
|
||||
this.sourceList.forEach(source => {
|
||||
if (source.type=='PostGre'){
|
||||
|
|
Loading…
Reference in New Issue