fixed 代码库对接类目

This commit is contained in:
lwh 2023-06-30 09:38:32 +08:00
parent 7602fe6629
commit b590b01a1d
5 changed files with 221 additions and 187 deletions

View File

@ -19,7 +19,7 @@ export default defineComponent({
params = {},
loading = {},
debug = false,
border = true,
border = false,
...attr
} = attrs;

View File

@ -3,15 +3,16 @@
<el-form ref="formRef" :model="formData" :rules="rules">
<el-row>
<el-col :span="12">
<el-form-item :label-width="labelWidth" label="所属客户" prop="customer_guid">
<el-input v-model='formData.customer_guid' type="text" placeholder='请输入所属客户'></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label-width="labelWidth" label="类目" prop="code_module_catetory_guid">
<el-input v-model='formData.code_module_catetory_guid' type="text" placeholder='请输入类目'></el-input>
<el-form-item :label-width="labelWidth" label="类目" prop="code_module_category_guid">
<el-cascader class="w100" filterable :options="dataList"
:props="{ checkStrictly: false, value: 'code_module_category_guid', label: 'code_module_category_name', emitPath: false }"
placeholder="请选择类目" clearable v-model="formData.code_module_category_guid">
<template #default="{ node, data }">
<span>{{ data.code_module_category_name }}</span>
<span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
</template>
</el-cascader>
</el-form-item>
</el-col>
<el-col :span="12">
@ -64,6 +65,7 @@
<script setup>
import { reactive, ref, watch } from "vue";
import { addCodeModule, getDictionary } from "~/service/code_module";
import { getCodeModuleCategoryList } from "~/service/code_module_category";
import { useLoginStore } from "~/store";
// --
@ -80,7 +82,15 @@ async function get_audit_status() {
})
}
//
const dataList = ref([])
async function getList() {
await getCodeModuleCategoryList({ 'all': true }).then((res) => {
if (res.code == 0) {
dataList.value = res.data
}
})
}
// --
@ -110,10 +120,10 @@ watch(props, (v) => {
});
const rules = reactive({
code_module_catetory_guid: [
code_module_category_guid: [
{
required: true,
message: '类目不能为空'
message: '代码库类目不能为空'
}
],
code_module_name: [
@ -147,9 +157,9 @@ const rules = reactive({
// --
//
const openDialog = () => {
get_audit_status()
const openDialog = async () => {
await get_audit_status()
await getList()
};
const closeDialog = () => {

View File

@ -3,35 +3,36 @@
<el-form ref="formRef" :model="formData" :disabled="true">
<el-row>
<el-col :span="12">
<el-form-item :label-width="labelWidth" label="所属客户" prop="customer_guid">
<el-input v-model='formData.customer_guid' type="text" placeholder='请输入所属客户'></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label-width="labelWidth" label="类目" prop="code_module_catetory_guid">
<el-input v-model='formData.code_module_catetory_guid' type="text" placeholder='请输入类目'></el-input>
<el-cascader class="w100" filterable :options="dataList"
:props="{ checkStrictly: false, value: 'code_module_category_guid', label: 'code_module_category_name', emitPath: false }"
placeholder="请选择类目" clearable v-model="formData.code_module_category_guid">
<template #default="{ node, data }">
<span>{{ data.code_module_category_name }}</span>
<span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
</template>
</el-cascader>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label-width="labelWidth" label="代码块名称" prop="code_module_name">
<el-input v-model='formData.code_module_name' type="text" placeholder='请输入代码块名称'></el-input>
<el-input v-model='formData.code_module_name' type="text"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item :label-width="labelWidth" label="html内容" prop="code_module_html">
<el-input v-model='formData.code_module_html' type="textarea" :rows="5" placeholder='请输入html内容'></el-input>
<el-input v-model='formData.code_module_html' type="textarea" :rows="5"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item :label-width="labelWidth" label="style内容" prop="code_module_style">
<el-input v-model='formData.code_module_style' type="textarea" :rows="5" placeholder='请输入style内容'></el-input>
<el-input v-model='formData.code_module_style' type="textarea" :rows="5"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item :label-width="labelWidth" label="script内容" prop="code_module_script">
<el-input v-model='formData.code_module_script' type="textarea" :rows="5" placeholder='请输入script内容'></el-input>
<el-input v-model='formData.code_module_script' type="textarea" :rows="5"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
@ -41,12 +42,9 @@
</el-col>
<el-col :span="12">
<el-form-item label="审核状态" prop="code_module_audit">
<el-select v-model="formData.code_module_audit" clearable placeholder="请选择">
<el-option
v-for="item in audit_status"
:key="item.dictionary_guid" :label="item.dictionary_name"
:value="item.dictionary_value"
></el-option>
<el-select v-model="formData.code_module_audit" clearable>
<el-option v-for="item in audit_status" :key="item.dictionary_guid" :label="item.dictionary_name"
:value="item.dictionary_value"></el-option>
</el-select>
</el-form-item>
</el-col>
@ -59,6 +57,7 @@
<script setup>
import { reactive, ref, watch } from "vue";
import { isEmptyObject } from "~/utils/index";
import { getCodeModuleCategoryList } from "~/service/code_module_category";
import { getDictionary } from '~/service/code_module';
// --
@ -75,6 +74,15 @@ import { getDictionary } from '~/service/code_module';
})
}
//
const dataList = ref([])
async function getList() {
await getCodeModuleCategoryList({ 'all': true }).then((res) => {
if (res.code == 0) {
dataList.value = res.data
}
})
}
// --
@ -100,9 +108,9 @@ watch(props, (v) => {
});
//
const openDialog = () => {
get_audit_status()
const openDialog = async () => {
await get_audit_status()
await getList()
};
@ -111,6 +119,4 @@ const closeDialog = () => {
};
</script>
<style lang="less" scoped>
</style>
<style lang="less" scoped></style>

View File

@ -3,15 +3,16 @@
<el-form ref="formRef" :model="formData" :rules="rules">
<el-row>
<el-col :span="12">
<el-form-item :label-width="labelWidth" label="所属客户" prop="customer_guid">
<el-input v-model='formData.customer_guid' type="text" placeholder='请输入所属客户'></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label-width="labelWidth" label="类目" prop="code_module_catetory_guid">
<el-input v-model='formData.code_module_catetory_guid' type="text" placeholder='请输入类目'></el-input>
<el-cascader class="w100" filterable :options="dataList"
:props="{ checkStrictly: false, value: 'code_module_category_guid', label: 'code_module_category_name', emitPath: false }"
placeholder="请选择类目" clearable v-model="formData.code_module_category_guid">
<template #default="{ node, data }">
<span>{{ data.code_module_category_name }}</span>
<span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
</template>
</el-cascader>
</el-form-item>
</el-col>
<el-col :span="12">
@ -31,7 +32,8 @@
</el-col>
<el-col :span="24">
<el-form-item :label-width="labelWidth" label="script内容" prop="code_module_script">
<el-input v-model='formData.code_module_script' type="textarea" :rows="5" placeholder='请输入script内容'></el-input>
<el-input v-model='formData.code_module_script' type="textarea" :rows="5"
placeholder='请输入script内容'></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
@ -42,11 +44,8 @@
<el-col :span="12">
<el-form-item label="审核状态" prop="code_module_audit">
<el-select v-model="formData.code_module_audit" clearable placeholder="请选择">
<el-option
v-for="item in audit_status"
:key="item.dictionary_guid" :label="item.dictionary_name"
:value="item.dictionary_value"
></el-option>
<el-option v-for="item in audit_status" :key="item.dictionary_guid" :label="item.dictionary_name"
:value="item.dictionary_value"></el-option>
</el-select>
</el-form-item>
</el-col>
@ -65,8 +64,10 @@
<script setup>
import { reactive, ref, watch } from "vue";
import { editCodeModule, getDictionary } from "~/service/code_module";
import { getCodeModuleCategoryList } from "~/service/code_module_category";
import { useLoginStore } from "~/store";
// --
@ -81,6 +82,15 @@ import { useLoginStore } from "~/store";
})
}
//
const dataList = ref([])
async function getList() {
await getCodeModuleCategoryList({ 'all': true }).then((res) => {
if (res.code == 0) {
dataList.value = res.data
}
})
}
@ -115,9 +125,9 @@ watch(props, (v) => {
});
//
const openDialog = () => {
get_audit_status()
const openDialog = async () => {
await get_audit_status()
await getList()
};
const closeDialog = () => {
@ -183,6 +193,4 @@ const handleResetClick = async (formEl) => {
};
</script>
<style lang="less" scoped>
</style>
<style lang="less" scoped></style>

View File

@ -7,11 +7,15 @@
<!-- 搜索 -->
<el-form inline :model="params">
<el-form-item label="客户名称">
<el-input v-model='params.customer_name' placeholder='请输入客户名称'></el-input>
</el-form-item>
<el-form-item label="类目">
<el-input v-model='params.code_module_catetory_guid' placeholder='请输入类目'></el-input>
<el-cascader class="w100" filterable :options="dataList"
:props="{ checkStrictly: false, value: 'code_module_category_guid', label: 'code_module_category_name', emitPath: false }"
placeholder="请选择类目" clearable v-model="params.code_module_category_guid">
<template #default="{ node, data }">
<span>{{ data.code_module_category_name }}</span>
<span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
</template>
</el-cascader>
</el-form-item>
<el-form-item label="代码块名称">
<el-input v-model='params.code_module_name' placeholder='请输入代码块名称'></el-input>
@ -124,6 +128,7 @@ import { ArrowDown } from '@element-plus/icons-vue';
import { ref, reactive, watch } from 'vue';
import { useLoginStore } from "~/store";
import { getCodeModuleList, editCodeModule, deleteCodeModule, getDictionary, downloadTemplate, importExcel, exportExcel, audit } from '~/service/code_module';
import { getCodeModuleCategoryList } from "~/service/code_module_category";
import AddCodeModuleDialog from './components/AddCodeModuleDialog.vue';
import EditCodeModuleDialog from './components/EditCodeModuleDialog.vue';
import DetailCodeModuleDialog from './components/DetailCodeModuleDialog.vue';
@ -146,7 +151,7 @@ const headers = {
//
const params = reactive({
customer_guid: "",
code_module_catetory_guid: "",
code_module_category_guid: "",
code_module_name: "",
code_module_audit: "",
@ -158,12 +163,7 @@ const column = [
type: 'selection'
},
{
prop: "customer_name",
label: '所属客户',
width: '150'
},
{
prop: "code_module_catetory_name",
prop: "code_module_category_name",
label: '类目',
width: '150'
},
@ -226,6 +226,16 @@ function handleDetail(row) {
DetailCodeModuleDialogRow.value = row
}
//
const dataList = ref([])
async function getList() {
await getCodeModuleCategoryList({ 'all': true }).then((res) => {
if (res.code == 0) {
dataList.value = res.data
}
})
}
getList()
//
let loadingImoprt = null;