fix: 修复完善了字典表的新增,删除,和字典表数据的新增,修改,以及在资产数据字典的展示

master
yaoxin 2024-04-25 22:39:48 +08:00
parent 723edee74f
commit e90fa588c7
8 changed files with 201 additions and 39 deletions

View File

@ -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'
})
}

View File

@ -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) { export function delSource(id) {
return request({ return request({

View File

@ -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'
})
}

View File

@ -84,6 +84,8 @@
<script> <script>
import { parseTime } from '@/utils/muyu' import { parseTime } from '@/utils/muyu'
import {listDept} from "@/api/system/dept";
import {listUser} from "@/api/system/user";
export default { export default {
props:{ props:{
@ -95,10 +97,12 @@ export default {
// //
loading: true, loading: true,
activeName: "dept", activeName: "dept",
// //
total: 0, userQueryParams: {
pageNum: 1, pageNum: 1,
pageSize: 1, pageSize: 10,
total: 0
},
// //
baseInfo: { baseInfo: {
name: "测试1", name: "测试1",
@ -114,10 +118,28 @@ export default {
created() { created() {
this.loading = true; this.loading = true;
setTimeout(() => this.loading = false, 200) setTimeout(() => this.loading = false, 200)
this.init() this.getList()
this.getUserList()
}, },
methods: { methods: {
parseTime, 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(){ init(){
let response = { let response = {
"code": 200, "code": 200,

View File

@ -41,7 +41,7 @@
<el-table <el-table
v-loading="loading" v-loading="loading"
:data="deptList" :data="deptList"
:default-expand-all="isExpandAll" :default-expand-all="true"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}" :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
row-key="deptId" row-key="deptId"
> >
@ -67,7 +67,6 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination v-show="total> 0" :limit.sync="pageSize" :page.sync="pageNum" :total="total"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="用户授权" name="user"> <el-tab-pane label="用户授权" name="user">
<el-table ref="table" v-loading="loading" :data="userList"> <el-table ref="table" v-loading="loading" :data="userList">
@ -90,7 +89,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </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-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
@ -100,6 +99,7 @@
import { parseTime } from '@/utils/muyu' import { parseTime } from '@/utils/muyu'
import {listDept} from "@/api/system/dept"; import {listDept} from "@/api/system/dept";
import {listUser} from "@/api/system/user";
export default { export default {
props:{ props:{
@ -113,9 +113,12 @@ export default {
loading: true, loading: true,
activeName: "dept", activeName: "dept",
// //
total: 0, //
userQueryParams: {
pageNum: 1, pageNum: 1,
pageSize: 1, pageSize: 10,
total: 0
},
// //
deptList: [], deptList: [],
// //
@ -126,6 +129,7 @@ export default {
this.loading = true; this.loading = true;
setTimeout(() => this.loading = false, 200) setTimeout(() => this.loading = false, 200)
this.getList() this.getList()
this.getUserList()
}, },
methods: { methods: {
/** 查询部门列表 */ /** 查询部门列表 */
@ -137,6 +141,14 @@ export default {
this.loading = false; this.loading = false;
}); });
}, },
/** 查询用户列表 */
getUserList() {
listUser(this.addDateRange(this.userQueryParams, [])).then(response => {
this.userList = response.data.rows;
this.userQueryParams.total = response.data.total;
}
);
},
parseTime, parseTime,
init(){ init(){
// this.deptList = this.handleTree(response.data, "deptId"); // this.deptList = this.handleTree(response.data, "deptId");

View File

@ -55,13 +55,9 @@
placement="left" placement="left"
width="200" width="200"
trigger="hover"> trigger="hover">
<el-table :data="[ <el-table :data="scope.row.dictionaryDatas">
{ label: '男', value: '1' },
{ label: '女', value: '2' },
{ label: '未知', value: '0' },
]">
<el-table-column property="label" label="字典标签"/> <el-table-column property="label" label="字典标签"/>
<el-table-column property="value" label="字典值"/> <el-table-column property="val" label="字典值"/>
</el-table> </el-table>
<el-tag slot="reference">{{scope.row.dictKey}}</el-tag> <el-tag slot="reference">{{scope.row.dictKey}}</el-tag>
</el-popover> </el-popover>
@ -166,13 +162,13 @@
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="formStatus = false"> </el-button> <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> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import {assetModelList} from "@/api/etl/source"; import {assetModelList, updateAssetModel, updateSource} from "@/api/etl/source";
import {getDictionaryList} from "@/api/etl/dictionary"; import {getDictionaryList} from "@/api/etl/dictionary";
export default { export default {
@ -181,9 +177,7 @@ export default {
'title': { 'title': {
handler(val) { handler(val) {
this.getDictionaryList() this.getDictionaryList()
assetModelList(val).then(res => { this.assetModelList()
this.tableData = res.data
})
}, },
immediate: true immediate: true
}, },
@ -192,6 +186,7 @@ export default {
this.dictMap.forEach(dict => { this.dictMap.forEach(dict => {
if (dict.dictionaryKey === val){ if (dict.dictionaryKey === val){
this.dictionaryDataList = dict.dictionaryDataList this.dictionaryDataList = dict.dictionaryDataList
this.form.dictionaryId = dict.id
} }
}) })
} }
@ -210,13 +205,32 @@ export default {
dictMap: {} dictMap: {}
} }
}, },
created() {
},
methods: { 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() {
getDictionaryList(this.title.dataSourceId).then(res => { getDictionaryList(this.title.dataSourceId).then(res => {
this.dictMap = res.data this.dictMap = res.data
console.log(this.dictMap)
}) })
}, },
update(row) { async update(row) {
await this.getDictionaryList()
this.form = row; this.form = row;
this.formStatus = true; this.formStatus = true;
} }

View File

@ -116,7 +116,7 @@
<el-col :span="24"> <el-col :span="24">
<el-tabs v-model="activeName" type="border-card"> <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"> <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-tab-pane>
</el-tabs> </el-tabs>
</el-col> </el-col>
@ -172,13 +172,17 @@ export default {
}, },
methods: { methods: {
deleteDictionary(id) { deleteDictionary(id) {
deleteDictionary(id); deleteDictionary(id).then(res => {
this.getDictionaryList() this.getDictionaryList()
// this.$nextTick(() => {
// this.$refs.assetStru.assetModelList()
// })
})
}, },
getDictionaryList() { getDictionaryList() {
getDictionaryList(this.title.id).then(res => { getDictionaryList(this.title.id).then(res => {
this.dictMap = res.data this.dictMap = res.data
console.log(this.dictMap)
}) })
}, },
editConfirm(dict,row){ editConfirm(dict,row){
@ -189,14 +193,25 @@ export default {
console.log(row) console.log(row)
if (row.id) { if (row.id) {
console.log('修改') console.log('修改')
updateData(row) updateData(row).then(res => {
row.edit = false;
this.getDictionaryList()
// this.$nextTick(() => {
// this.$refs.assetStru.assetModelList()
// })
})
}else{ }else{
console.log('添加') console.log('添加')
row.dictionaryId=dict.id row.dictionaryId=dict.id
addData(row) addData(row).then(res => {
}
row.edit = false; row.edit = false;
this.getDictionaryList() this.getDictionaryList()
// this.$nextTick(() => {
// this.$refs.assetStru.assetModelList()
// })
})
}
}, },
addDict(){ addDict(){
if (!this.dictInfo.dictionaryName){ if (!this.dictInfo.dictionaryName){
@ -208,13 +223,15 @@ export default {
return; return;
} }
this.dictInfo.dataSourceId = this.title.id this.dictInfo.dataSourceId = this.title.id
addDictionary(this.dictInfo) addDictionary(this.dictInfo).then(res => {
this.dictInfo = { this.dictInfo = {
dictionaryName: null, dictionaryName: null,
dictionaryKey: null, dictionaryKey: null,
dataSourceId: null dataSourceId: null
} }
this.getDictionaryList() this.getDictionaryList()
})
}, },
handleSetLineChartData(type) { handleSetLineChartData(type) {
this.$emit('handleSetLineChartData', type) this.$emit('handleSetLineChartData', type)

View File

@ -139,7 +139,7 @@ export default {
}) })
}, },
getList() { getList() {
listSource(this.queryParams).then(response => { listSource({}).then(response => {
this.sourceList = response.data.rows; this.sourceList = response.data.rows;
this.sourceList.forEach(source => { this.sourceList.forEach(source => {
if (source.type=='PostGre'){ if (source.type=='PostGre'){