fix:代码块类目模块优化
This commit is contained in:
parent
6a5124755a
commit
499fff8e28
@ -1,12 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- 面包屑 -->
|
<!-- 面包屑 -->
|
||||||
<el-breadcrumb>
|
<el-breadcrumb v-if="!code_module_category">
|
||||||
<el-breadcrumb-item>代码块管理</el-breadcrumb-item>
|
<el-breadcrumb-item>代码块管理</el-breadcrumb-item>
|
||||||
<el-breadcrumb-item to="/code_module/list">代码块列表</el-breadcrumb-item>
|
<el-breadcrumb-item to="/code_module/list">代码块列表</el-breadcrumb-item>
|
||||||
</el-breadcrumb>
|
</el-breadcrumb>
|
||||||
<!-- 搜索 -->
|
<!-- 搜索 -->
|
||||||
<el-form inline :model="params">
|
<el-form v-if="code_module_category != false" inline :model="params">
|
||||||
|
|
||||||
<el-form-item label="类目">
|
<el-form-item label="类目">
|
||||||
<el-cascader class="w100" filterable :options="dataList"
|
<el-cascader class="w100" filterable :options="dataList"
|
||||||
:props="{ checkStrictly: false, value: 'code_module_category_guid', label: 'code_module_category_name', emitPath: false }"
|
:props="{ checkStrictly: false, value: 'code_module_category_guid', label: 'code_module_category_name', emitPath: false }"
|
||||||
@ -151,11 +150,23 @@ const headers = {
|
|||||||
// 查询参数
|
// 查询参数
|
||||||
const params = reactive({
|
const params = reactive({
|
||||||
customer_guid: "",
|
customer_guid: "",
|
||||||
code_module_category_guid: "",
|
code_module_category_guid: props.code_module_category.code_module_category_guid ? props.code_module_category.code_module_category_guid : "",
|
||||||
code_module_name: "",
|
code_module_name: "",
|
||||||
code_module_audit: "",
|
code_module_audit: "",
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
code_module_category: Object,
|
||||||
|
});
|
||||||
|
watch(props, (v) => {
|
||||||
|
params.code_module_category_guid = props.code_module_category.code_module_category_guid
|
||||||
|
});
|
||||||
|
if (props.code_module_category) {
|
||||||
|
params.code_module_category_guid = props.code_module_category.code_module_category_guid
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const column = [
|
const column = [
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -226,6 +237,7 @@ function handleDetail(row) {
|
|||||||
DetailCodeModuleDialogRow.value = row
|
DetailCodeModuleDialogRow.value = row
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//获取代码块类目树形列表
|
//获取代码块类目树形列表
|
||||||
const dataList = ref([])
|
const dataList = ref([])
|
||||||
async function getList() {
|
async function getList() {
|
||||||
|
@ -175,12 +175,6 @@ const rules = reactive({
|
|||||||
message: '类目名不能为空'
|
message: '类目名不能为空'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
code_module_category_ps: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '补充不能为空'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
code_module_category_sort: [
|
code_module_category_sort: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
|
@ -193,12 +193,6 @@ const rules = reactive({
|
|||||||
message: '类目名不能为空'
|
message: '类目名不能为空'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
code_module_category_ps: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '补充不能为空'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
code_module_category_sort: [
|
code_module_category_sort: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
|
@ -0,0 +1,57 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog v-model="props.modelValue" title="查看代码块列表" width="85%" @closed="closeDialog" @open="openDialog">
|
||||||
|
<CodeModuleLisrView v-if="formData" :code_module_category="formData">
|
||||||
|
</CodeModuleLisrView>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { reactive, ref, watch } from "vue";
|
||||||
|
import { editCodeModuleCategory, getDictionary, getCodeModuleCategoryList, getCodeModuleCategoryInfo } from "~/service/code_module_category";
|
||||||
|
import { getCustomerOptionList } from "~/service/customer";
|
||||||
|
import { useLoginStore } from "~/store";
|
||||||
|
import CodeModuleLisrView from "~/pages/index/code/code_module/index.vue";
|
||||||
|
|
||||||
|
// --基础参数
|
||||||
|
const store = useLoginStore();
|
||||||
|
const headers = {
|
||||||
|
Accept: "application/json",
|
||||||
|
...store.headers,
|
||||||
|
};
|
||||||
|
const isBtnLod = ref(false);
|
||||||
|
const formRef = ref();
|
||||||
|
const labelWidth = 100;
|
||||||
|
const props = defineProps({
|
||||||
|
modelValue: Boolean,
|
||||||
|
data: Object,
|
||||||
|
done: Function,
|
||||||
|
});
|
||||||
|
const emits = defineEmits(["update:modelValue"]);
|
||||||
|
const formData = ref({
|
||||||
|
...props.data,
|
||||||
|
});
|
||||||
|
const uoloadData = ref({
|
||||||
|
dirName: "CodeModuleCategory"
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
// --基础方法
|
||||||
|
watch(props, (v) => {
|
||||||
|
formData.value = v.data;
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
// 打开弹窗时执行
|
||||||
|
const openDialog = async () => {
|
||||||
|
};
|
||||||
|
|
||||||
|
const closeDialog = () => {
|
||||||
|
props.done();
|
||||||
|
emits("update:modelValue", false);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped></style>
|
||||||
|
|
@ -55,6 +55,9 @@
|
|||||||
<el-dropdown-item @click="handleDelete(selectionData)">
|
<el-dropdown-item @click="handleDelete(selectionData)">
|
||||||
批量删除
|
批量删除
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
|
<el-dropdown-item @click="handleAudit(selectionData)">
|
||||||
|
批量审核
|
||||||
|
</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</template>
|
</template>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
@ -65,6 +68,28 @@
|
|||||||
row-key="code_module_category_guid" :tree-props="{ children: 'children' }">
|
row-key="code_module_category_guid" :tree-props="{ children: 'children' }">
|
||||||
<el-table-column type="selection" width="50" align="center" />
|
<el-table-column type="selection" width="50" align="center" />
|
||||||
<el-table-column prop="code_module_category_name" width="200" label="类目名称" :show-overflow-tooltip="true">
|
<el-table-column prop="code_module_category_name" width="200" label="类目名称" :show-overflow-tooltip="true">
|
||||||
|
<template #default="scope">
|
||||||
|
<span>
|
||||||
|
<Icon v-if="scope.row.code_module_category_parent_guid == '0'" name="ElIconFolderOpened" />
|
||||||
|
<Icon v-else name="ElIconFolder" />
|
||||||
|
{{ scope.row.code_module_category_name }}
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="code_module_category_library_type" width="100" label="库类型" :show-overflow-tooltip="true">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :options='library_type' :value='scope.row.code_module_category_library_type' />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="global_mode" width="200" label="全局模式" :show-overflow-tooltip="true">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :options='global_mode' :value='scope.row.code_module_category_global_mode' />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="code_module_category_audit" width="100" label="审核状态" :show-overflow-tooltip="true">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :options='audit_status' :value='scope.row.code_module_category_audit' />
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column sortable prop="code_module_category_sort" width="200" label="排序" sort>
|
<el-table-column sortable prop="code_module_category_sort" width="200" label="排序" sort>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
@ -73,7 +98,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="操作" width="200" fixed='right'>
|
<el-table-column width="350" label="操作" fixed='right'>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button size="small" type="primary" @click="handleUpdate(scope.row)">编辑</el-button>
|
<el-button size="small" type="primary" @click="handleUpdate(scope.row)">编辑</el-button>
|
||||||
<el-dropdown style="margin: 0 10px;">
|
<el-dropdown style="margin: 0 10px;">
|
||||||
@ -87,6 +112,14 @@
|
|||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</template>
|
</template>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
|
<el-button v-if="scope.row.code_module_category_parent_guid != '0'" type="danger" size="small"
|
||||||
|
@click="handleLookCodeModuleList(scope.row)">
|
||||||
|
查看代码块列表
|
||||||
|
</el-button>
|
||||||
|
<el-button v-if="scope.row.code_module_category_audit == 1" type="warning" size="small"
|
||||||
|
@click="handleAudit([scope.row])">
|
||||||
|
审核
|
||||||
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@ -102,15 +135,20 @@
|
|||||||
<!-- 代码块类目详情 -->
|
<!-- 代码块类目详情 -->
|
||||||
<DetailCodeModuleCategoryDialog v-model="DetailCodeModuleCategoryDialogVisible"
|
<DetailCodeModuleCategoryDialog v-model="DetailCodeModuleCategoryDialogVisible"
|
||||||
:data="DetailCodeModuleCategoryDialogRow"></DetailCodeModuleCategoryDialog>
|
:data="DetailCodeModuleCategoryDialogRow"></DetailCodeModuleCategoryDialog>
|
||||||
|
<!-- 查看代码块列表 -->
|
||||||
|
<LookCodeModuleListDialog :done="() => getList()" v-model="LookCodeModuleListDialogVisible"
|
||||||
|
:data="LookCodeModuleListDialogRow">
|
||||||
|
</LookCodeModuleListDialog>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ArrowDown } from '@element-plus/icons-vue';
|
import { ArrowDown } from '@element-plus/icons-vue';
|
||||||
import { ref, reactive, watch } from 'vue';
|
import { ref, reactive, watch } from 'vue';
|
||||||
import { useLoginStore } from "~/store";
|
import { useLoginStore } from "~/store";
|
||||||
import { getCodeModuleCategoryList, editCodeModuleCategory, deleteCodeModuleCategory, getDictionary } from '~/service/code_module_category';
|
import { getCodeModuleCategoryList, editCodeModuleCategory, deleteCodeModuleCategory, getDictionary, auditCodeModuleCategory } from '~/service/code_module_category';
|
||||||
import AddCodeModuleCategoryDialog from './components/AddCodeModuleCategoryDialog.vue';
|
import AddCodeModuleCategoryDialog from './components/AddCodeModuleCategoryDialog.vue';
|
||||||
import EditCodeModuleCategoryDialog from './components/EditCodeModuleCategoryDialog.vue';
|
import EditCodeModuleCategoryDialog from './components/EditCodeModuleCategoryDialog.vue';
|
||||||
import DetailCodeModuleCategoryDialog from './components/DetailCodeModuleCategoryDialog.vue';
|
import DetailCodeModuleCategoryDialog from './components/DetailCodeModuleCategoryDialog.vue';
|
||||||
|
import LookCodeModuleListDialog from './components/LookCodeModuleListDialog.vue';
|
||||||
|
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
const selectionData = ref([]);
|
const selectionData = ref([]);
|
||||||
@ -121,6 +159,8 @@ const EditCodeModuleCategoryDialogVisible = ref(false);
|
|||||||
const EditCodeModuleCategoryDialogRow = ref({});
|
const EditCodeModuleCategoryDialogRow = ref({});
|
||||||
const DetailCodeModuleCategoryDialogVisible = ref(false);
|
const DetailCodeModuleCategoryDialogVisible = ref(false);
|
||||||
const DetailCodeModuleCategoryDialogRow = ref({});
|
const DetailCodeModuleCategoryDialogRow = ref({});
|
||||||
|
const LookCodeModuleListDialogVisible = ref(false);
|
||||||
|
const LookCodeModuleListDialogRow = ref({});
|
||||||
|
|
||||||
const headers = {
|
const headers = {
|
||||||
Accept: "application/json",
|
Accept: "application/json",
|
||||||
@ -133,25 +173,13 @@ const params = reactive({
|
|||||||
code_module_category_name: "",
|
code_module_category_name: "",
|
||||||
code_module_category_ps: "",
|
code_module_category_ps: "",
|
||||||
code_module_category_global_mode: "",
|
code_module_category_global_mode: "",
|
||||||
code_module_category_library_type: "2",
|
code_module_category_library_type: "",
|
||||||
customer: "",
|
customer: "",
|
||||||
code_module_category_audit: "2",
|
code_module_category_audit: "",
|
||||||
page: 1,
|
page: 1,
|
||||||
limit: 10,
|
limit: 10,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
const handleCommand = ({ type, row }) => {
|
|
||||||
switch (type) {
|
|
||||||
case "detail":
|
|
||||||
handleDetail(row);
|
|
||||||
break;
|
|
||||||
case 'delete':
|
|
||||||
handleDelete([row]);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const dataList = ref([])
|
const dataList = ref([])
|
||||||
function getList() {
|
function getList() {
|
||||||
getCodeModuleCategoryList(params).then((res) => {
|
getCodeModuleCategoryList(params).then((res) => {
|
||||||
@ -181,6 +209,37 @@ const handleDelete = data => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//审核数据
|
||||||
|
const handleAudit = data => {
|
||||||
|
let code_module_category_guid = data.map(v => v.code_module_category_guid).join()
|
||||||
|
ElMessageBox.confirm("是否通过审核?", "系统提示", {
|
||||||
|
distinguishCancelAndClose: true,
|
||||||
|
confirmButtonText: '通过',
|
||||||
|
cancelButtonText: '驳回',
|
||||||
|
type: "warning",
|
||||||
|
})
|
||||||
|
.then(async () => {
|
||||||
|
const res = await auditCodeModuleCategory({
|
||||||
|
code_module_category_guid: code_module_category_guid,
|
||||||
|
code_module_category_audit: 2,
|
||||||
|
});
|
||||||
|
if (res) {
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(async (action) => {
|
||||||
|
if (action == 'cancel') {
|
||||||
|
const res = await auditCodeModuleCategory({
|
||||||
|
code_module_category_guid: code_module_category_guid,
|
||||||
|
code_module_category_audit: 3,
|
||||||
|
});
|
||||||
|
if (res) {
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
};
|
||||||
|
|
||||||
// 修改
|
// 修改
|
||||||
function handleUpdate(row) {
|
function handleUpdate(row) {
|
||||||
EditCodeModuleCategoryDialogVisible.value = true
|
EditCodeModuleCategoryDialogVisible.value = true
|
||||||
@ -193,6 +252,12 @@ function handleDetail(row) {
|
|||||||
DetailCodeModuleCategoryDialogRow.value = row
|
DetailCodeModuleCategoryDialogRow.value = row
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 查看代码块列表
|
||||||
|
function handleLookCodeModuleList(row) {
|
||||||
|
LookCodeModuleListDialogVisible.value = true
|
||||||
|
LookCodeModuleListDialogRow.value = row
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 字典获取
|
// 字典获取
|
||||||
|
@ -4,13 +4,6 @@ import {
|
|||||||
createApiUrl
|
createApiUrl
|
||||||
} from '~/utils/axios';
|
} from '~/utils/axios';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取字典值
|
* 获取字典值
|
||||||
* @param {Object} data
|
* @param {Object} data
|
||||||
@ -64,6 +57,7 @@ export function addCodeModuleCategory(data) {
|
|||||||
errorMessageText: '添加失败'
|
errorMessageText: '添加失败'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 编辑代码块类目
|
* 编辑代码块类目
|
||||||
* @param {Object} data
|
* @param {Object} data
|
||||||
@ -75,4 +69,17 @@ export function editCodeModuleCategory(data) {
|
|||||||
// isShowSuccessMessage: true,
|
// isShowSuccessMessage: true,
|
||||||
errorMessageText: '编辑失败'
|
errorMessageText: '编辑失败'
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核代码类目
|
||||||
|
* @param {Object} data
|
||||||
|
* @return {Promise} api
|
||||||
|
*/
|
||||||
|
export function auditCodeModuleCategory(data) {
|
||||||
|
return api.post('Code.CodeModuleCategory/auditCodeModuleCategory', data, {
|
||||||
|
isTransformResponse: true,
|
||||||
|
isShowSuccessMessage: true,
|
||||||
|
errorMessageText: '操作失败'
|
||||||
|
});
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user