|
@@ -99,7 +99,7 @@
|
|
|
v-if="visible"
|
|
|
ref="dialogDictRef"
|
|
|
v-model="visible"
|
|
|
- :title="`${isCreate ? '新增' : '编辑'}项`"
|
|
|
+ :title="`${isCreate ? '新增' : '编辑'}表单分类`"
|
|
|
width="600px"
|
|
|
:form-data="activeData"
|
|
|
:form-options="formOptions"
|
|
@@ -109,8 +109,7 @@
|
|
|
</template>
|
|
|
<script lang="tsx" setup>
|
|
|
import dict from '@/api/system/dict'
|
|
|
-import formcategory from '@/api/system/formcategory'
|
|
|
-
|
|
|
+import formCategory from '@/api/system/formcategory'
|
|
|
import { computed, nextTick, ref, watch } from 'vue'
|
|
|
import { ElMessage, ElTree, ElMessageBox } from 'element-plus'
|
|
|
import { useTablePage } from '@/hooks/useTablePage'
|
|
@@ -122,25 +121,17 @@ const isCreate = ref(true)
|
|
|
const activeData = ref({})
|
|
|
const current_mode = ref('') // 当前模式 (tree | table)
|
|
|
const formsDialog = [
|
|
|
- {
|
|
|
- prop: 'pid',
|
|
|
- label: '所属字典',
|
|
|
- itemType: 'select',
|
|
|
- filterable: true,
|
|
|
- options: [],
|
|
|
- rules: [{ required: true, message: '请选择所属字典', trigger: 'blur' }]
|
|
|
- },
|
|
|
{
|
|
|
prop: 'name',
|
|
|
- label: '项名称',
|
|
|
+ label: '分类名称',
|
|
|
itemType: 'input',
|
|
|
- rules: [{ required: true, message: '请输入项名称', trigger: 'blur' }]
|
|
|
+ rules: [{ required: true, message: '请输入分类名称', trigger: 'blur' }]
|
|
|
},
|
|
|
{
|
|
|
prop: 'code',
|
|
|
- label: '编码',
|
|
|
+ label: '分类编码',
|
|
|
itemType: 'input',
|
|
|
- rules: [{ required: true, message: '请输入编码', trigger: 'blur' }]
|
|
|
+ rules: [{ required: true, message: '请输入分类编码', trigger: 'blur' }]
|
|
|
},
|
|
|
{
|
|
|
prop: 'status',
|
|
@@ -200,7 +191,7 @@ const treeData = ref([])
|
|
|
// 获取左侧菜单数据
|
|
|
const getGroup = async () => {
|
|
|
showGroupLoading.value = true
|
|
|
- let data = await formcategory.formCategoryListAllApi()
|
|
|
+ let data = await formCategory.formCategoryListAllApi()
|
|
|
formOptions.value.forms[0].options = data.map(item => {
|
|
|
return { value: item.id, label: item.name }
|
|
|
})
|
|
@@ -327,16 +318,12 @@ const { searchData, tableOpts, checkedColumns, activeColumns, curSelectionRows,
|
|
|
|
|
|
// 删除
|
|
|
const deleteItem = async ids => {
|
|
|
- // try {
|
|
|
- await dict.dictDeleteApi(ids)
|
|
|
+ await formCategory.formCategoryDeleteApi(ids)
|
|
|
if (current_mode.value === 'tree') {
|
|
|
getGroup()
|
|
|
}
|
|
|
updateParams()
|
|
|
ElMessage.success(`删除成功~`)
|
|
|
- // } catch (e) {
|
|
|
- // ElMessage.error(`删除失败~`)
|
|
|
- // }
|
|
|
}
|
|
|
|
|
|
// 单个删除
|
|
@@ -369,7 +356,7 @@ const submitHandler = async params => {
|
|
|
formOptions.value.formConfig.submitLoading = true
|
|
|
params.status = params.status ? 1 : 0
|
|
|
params.id = activeData.value.id ? activeData.value.id : null
|
|
|
- await dict.dictAddOrEditSaveApi(params)
|
|
|
+ await formCategory.formCategoryAddOrEditSaveApi(params)
|
|
|
ElMessage.success(`${isCreate.value ? '新增' : '修改'}成功~`)
|
|
|
visible.value = false
|
|
|
if (current_mode.value === 'tree') {
|