Browse Source

问题处理

master
si@aidatagov.com 3 weeks ago
parent
commit
c155fbe742
  1. 6
      vue-fastapi-backend/module_admin/service/data_ast_content_service.py
  2. 144
      vue-fastapi-frontend/src/views/dataAsset/assetDetail/index.vue
  3. 1
      vue-fastapi-frontend/src/views/dataAsset/directory/index.vue

6
vue-fastapi-backend/module_admin/service/data_ast_content_service.py

@ -308,14 +308,16 @@ class DataCatalogService:
"""
移动数据目录service
"""
if request.content_onum == request.supr_content_onum_after:
raise ServiceException(
message="非法操作:不能将目录移动到自身目录下"
)
moved_catalog_data = {
'content_onum': request.content_onum,
'supr_content_onum': request.supr_content_onum,
'supr_content_onum_after': request.supr_content_onum_after
}
try:
await DataCatalogDAO.moved_catalog_instr_dao(query_db, moved_catalog_data)
await query_db.commit()

144
vue-fastapi-frontend/src/views/dataAsset/assetDetail/index.vue

@ -144,27 +144,11 @@
</el-form-item>
<el-form-item label="表类型" prop="dataAstType">
<el-select v-model="form.dataAstType" placeholder="请选择" clearable style="width: 100%" :disabled="true">
<!-- <el-form-item label="资产编号" prop="astNo">
<el-input v-model="form.astNo" placeholder="请输入" />
</el-form-item>
<el-form-item label="资产英文名称" prop="dataAstEngName">
<el-input v-model="form.dataAstEngName" placeholder="请输入" />
</el-form-item>
<el-form-item label="资产中文名称" prop="dataAstCnName">
<el-input v-model="form.dataAstCnName" placeholder="请输入" />
</el-form-item>
<el-form-item label="资产类型" prop="dataAstType">
<el-select v-model="form.dataAstType" placeholder="请选择" clearable style="width: 100%"> -->
<el-option label="表" value="表" />
<el-option label="报表" value="报表" />
</el-select>
</el-form-item>
<!-- <el-form-item label="资产状态" prop="dataAstStat">
<el-select v-model="form.dataAstStat" placeholder="请选择" clearable style="width: 100%">
<el-option label="有效" value="1" />
<el-option label="作废" value="0" />
</el-select>
</el-form-item> -->
<el-form-item label="资产应用场景" prop="dataAstScreen">
<el-select v-model="form.dataAstScreen" placeholder="请选择" clearable style="width: 100%">
<el-option label="智能助手" value="智能助手" />
@ -176,9 +160,7 @@
<el-option v-for="(item, index) in dataAstScrenClas_list" :key="index" :label="item" :value="item" />
</el-select>
</el-form-item>
<el-form-item label="资产标签" prop="dataAstClas">
<el-input v-model="form.dataAstClas" placeholder="请输入" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="资产描述" prop="dataAstDesc">
<el-input v-model="form.dataAstDesc" placeholder="请输入" />
</el-form-item>
@ -192,9 +174,55 @@
<el-tree-select v-model="form.dataAstSrc" :data="treeDataChildren"
:props="{ value: 'name', label: 'name', children: 'children' }" value-key="id" placeholder="请选择"
check-strictly />
</el-form-item>
<el-form-item label="选择标签:">
<el-select
v-model="currentAstTag.clasOnum"
filterable
style="width: 240px"
@change="changeAstTag"
>
<el-option v-for="item in metaClasList" :key="item.clasOnum" :value="item.clasOnum" :label="item.clasOnum+' - '+item.clasName"/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Plus" @click="addAstTag">新增</el-button>
</el-form-item>
</el-form>
<template #footer>
<el-table v-loading="loading" :data="astTags">
<el-table-column label="标签编号" width="80" align="center" prop="onum"></el-table-column>
<el-table-column label="标签名称" width="120" align="center" prop="clasName"></el-table-column>
<el-table-column label="标签值" width="170" align="center" prop="clasValue" >
<template #default="scope">
<el-input @input="changeTagValue(scope.row)" v-model="scope.row.clasValue" :disabled="scope.row.clasEffFlag !== '1'"></el-input>
</template>
</el-table-column>
<el-table-column label="标签值说明" width="170" align="center" prop="tagRemark">
<template #default="scope">
<el-input @input="changeTagValue(scope.row)" v-model="scope.row.tagRemark" :disabled="scope.row.clasEffFlag !== '1'"></el-input>
</template>
</el-table-column>
<el-table-column label="标签状态" align="center" prop="clasEffFlag">
<template #default="scope">
<span v-if="scope.row.clasEffFlag === '1'" style="color:#67C23A;">{{'有效'}}</span>
<span v-else style="color: #F56C6C">{{'已删除'}}</span>
</template>
</el-table-column>
<el-table-column label="设置方式" width="80" align="center" prop="tagSource">
<template #default="scope">
<span>{{scope.row.tagSource ? scope.row.tagSource:'自动'}}</span>
</template>
</el-table-column>
<el-table-column label="设置对象" width="80" align="center" prop="setUser"></el-table-column>
<el-table-column label="设置时间" width="150" align="center" prop="setTime"></el-table-column>
<el-table-column label="操作" align="center" width="80">
<template #default="scope">
<el-button v-if="scope.row.clasEffFlag === '1'" link type="danger" icon="Delete" @click.prevent="deleteTag(scope.row)">删除</el-button>
<el-button v-if="scope.row.clasEffFlag === '0'" link type="success" icon="RefreshLeft" @click.prevent="revertTag(scope.row)">恢复</el-button>
</template>
</el-table-column>
</el-table> <template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
@ -206,6 +234,9 @@
<script setup name="AssetDetail">
import { getSearch, batch, deptTreeSelect } from "@/api/dataAsset/assetDetail";
import {getMetaClasList} from "@/api/meta/metaInfo"
import cache from "@/plugins/cache";
const { proxy } = getCurrentInstance()
const defaultProps = {
children: 'children',
@ -214,12 +245,22 @@ const defaultProps = {
import useUserStore from '@/store/modules/user'; //
const metaClasList = ref([]);
const userStore = useUserStore(); //
const dsSysList = userStore.dsSysList; // 访
const currentNode = ref({})
const treeData = ref([])
const treeDataChildren = ref([]);
const currentAstTag = ref({
"index":-1,
"clasThreClas": "",
"clasOnum": null,
"clasName": "",
"recSubmPrsn": "",
"clasPriClas": "",
"clasScdClas": ""
});
const getSrcSysName = (id) => {
if (id === null || id === undefined) return '';
const getName = (val) => {
@ -238,7 +279,21 @@ function addLabel(nodes) {
}
});
}
function changeTagValue(row){
row.tagSource = '手动'
}
function changeAstTag(){
if (typeof currentAstTag.value.clasOnum !== null){
for (let i = 0; i <metaClasList.value.length; i++) {
let item = metaClasList.value[i]
if (item.clasOnum === currentAstTag.value.clasOnum){
let index = currentAstTag.value.index
currentAstTag.value = item
currentAstTag.value.index = index
}
}
}
}
/** 查询部门下拉树结构 */
function getDeptTree() {
deptTreeSelect().then(response => {
@ -251,6 +306,7 @@ function getDeptTree() {
});
};
const astTags = ref([])
/** 节点单击事件 */
function handleNodeClick(data) {
@ -351,12 +407,47 @@ const resetQuery = () => {
proxy.$refs.treeRef.setCurrentKey(null);
handleQuery()
}
const handleAdd = () => { }
const handleAdd = () => {
astTags.value = []
}
const handleUpdate = (row) => {
open.value = true;
proxy.resetForm("assetRef");
form.value = row || ids.value[0];
astTags.value = JSON.parse(form.value.dataAstClas)||[]
}
function addAstTag(){
let json = JSON.parse(JSON.stringify(currentAstTag.value))
console.log(json,"json")
if (json.clasOnum !== null){
astTags.value.push({
onum: json.clasOnum,
clasName: json.clasName,
clasValue: '',
tagRemark:'',
clasEffFlag:'1',
tagSource:'手工',
setUser: cache.local.get("username"),
setTime: getNowDateTime()
})
} else {
proxy.$modal.msgWarning("请选择一个标签");
}
}
function getNowDateTime(){
const now = new Date();
const year = now.getFullYear();
const month = String(now.getMonth() + 1).padStart(2, '0');
const day = String(now.getDate()).padStart(2, '0');
const hours = String(now.getHours()).padStart(2, '0');
const minutes = String(now.getMinutes()).padStart(2, '0');
const seconds = String(now.getSeconds()).padStart(2, '0');
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
}
const handleDelete = (row) => {
const asset = row ? [row] : ids.value;
let submitasset = [];
@ -495,13 +586,14 @@ function submitForm() {
"dataAstDesc": form.value.dataAstDesc,
"dataAstScreen": form.value.dataAstScreen || "", //
"dataAstScrenClas": form.value.dataAstScrenClas || "", //
"dataAstClas": form.value.dataAstClas?form.value.dataAstClas:"",
"dataAstClas": JSON.stringify(astTags.value)?JSON.stringify(astTags.value):"",
"dataAstCont": form.value.dataAstCont?form.value.dataAstCont:"",
"dataAstFaq": form.value.dataAstFaq?form.value.dataAstFaq:"",
"dataAstSrc": form.value.dataAstSrc,
"versionNo": form.value.versionNo,
"ctrlFlag": form.value.ctrlFlag,
}
batch({ dataAssets: [submitform] }).then(response => {
proxy.$modal.msgSuccess("修改成功");
open.value = false;
@ -510,7 +602,9 @@ function submitForm() {
}
});
};
getMetaClasList().then(res=>{
metaClasList.value = res.data
})
function cancel() {
open.value = false;
form.value = {};

1
vue-fastapi-frontend/src/views/dataAsset/directory/index.vue

@ -589,6 +589,7 @@ const handleAddDialogOpen = (data) => {
formDialogRef.value.title = '新增目录'
formDialogRef.value.openDialog({
suprContentOnum: data.contentOnum,
children:[]
})
}

Loading…
Cancel
Save