From 86a90e42f4a607ea88acbba5717dee4b0a3f8365 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9B=B9=E7=A3=8A?= <45566618@qq.com>
Date: Sat, 11 Oct 2025 17:40:49 +0800
Subject: [PATCH] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E6=8C=87=E4=BB=A4:1=E3=80=81?=
=?UTF-8?q?=E5=88=86=E7=B1=BB=E6=A0=87=E7=AD=BE=E5=8A=A0=E6=95=B0=E6=8D=AE?=
=?UTF-8?q?=E5=AD=97=E5=85=B8=E7=B1=BB=E5=9E=8B=E6=8C=87=E5=AE=9A=EF=BC=8C?=
=?UTF-8?q?2=E3=80=81=E7=B1=BB=E5=88=AB=E3=80=81=E7=B1=BB=E5=9E=8B?=
=?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=BB=98=E8=AE=A4=E5=9B=BE=E7=89=87=E3=80=81?=
=?UTF-8?q?=E5=8A=A8=E6=80=81=E5=9B=BE=E7=89=87=E7=BB=84=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/InstructionTagForm.vue | 12 ++-
.../ConfigServiceCategory.api.ts | 3 +
.../components/ConfigServiceCategoryForm.vue | 75 ++++++++++++++-----
.../components/ConfigServiceCategoryModal.vue | 10 +--
.../ConfigServiceDirectiveList.vue | 29 ++++---
.../serviceType/ConfigServiceType.api.ts | 3 +
.../components/ConfigServiceTypeForm.vue | 66 ++++++++++++----
.../components/ConfigServiceTypeModal.vue | 7 +-
8 files changed, 151 insertions(+), 54 deletions(-)
diff --git a/src/views/services/instructiontag/components/InstructionTagForm.vue b/src/views/services/instructiontag/components/InstructionTagForm.vue
index a1cecb6..383fc46 100644
--- a/src/views/services/instructiontag/components/InstructionTagForm.vue
+++ b/src/views/services/instructiontag/components/InstructionTagForm.vue
@@ -12,6 +12,14 @@
:showCount="true" :disabled="titleDisabled">
+
+
+
+
+
@@ -26,7 +34,7 @@
+ placeholder="请选择是否启用" allowClear />
@@ -59,6 +67,7 @@ const titleDisabled = ref(false);
const formData = reactive>({
id: '',
instructionName: '',
+ instructionType: '',
sort: 99,
izEnabled: '0',
icon:'',
@@ -70,6 +79,7 @@ const confirmLoading = ref(false);
//表单验证
const validatorRules = reactive({
instructionName: [{ required: true, message: '请输入分类标签名称!' },],
+ instructionType: [{ required: true, message: '请选择分类标签类型!' },],
sort: [{ required: true, message: '请输入排序!' }, { pattern: /^\d+$/, message: '请输入正整数!' },],
icon: [{ required: true, message: '请选择图标!' }],
izEnabled: [{ required: true, message: '请选择是否启用!' },],
diff --git a/src/views/services/serviceCategory/ConfigServiceCategory.api.ts b/src/views/services/serviceCategory/ConfigServiceCategory.api.ts
index b3d3e90..64bcbfc 100644
--- a/src/views/services/serviceCategory/ConfigServiceCategory.api.ts
+++ b/src/views/services/serviceCategory/ConfigServiceCategory.api.ts
@@ -7,6 +7,7 @@ enum Api {
list = '/services/serviceCategory/configServiceCategory/list',
save = '/services/serviceCategory/configServiceCategory/add',
edit = '/services/serviceCategory/configServiceCategory/edit',
+ getInfo = '/services/serviceCategory/configServiceCategory/getInfo',
deleteOne = '/services/serviceCategory/configServiceCategory/delete',
deleteBatch = '/services/serviceCategory/configServiceCategory/deleteBatch',
importExcel = '/services/serviceCategory/configServiceCategory/importExcel',
@@ -31,6 +32,8 @@ export const getImportUrl = Api.importExcel;
*/
export const list = (params) => defHttp.get({ url: Api.list, params });
+export const getInfo = (params) => defHttp.get({ url: Api.getInfo, params });
+
/**
* 删除单个
* @param params
diff --git a/src/views/services/serviceCategory/components/ConfigServiceCategoryForm.vue b/src/views/services/serviceCategory/components/ConfigServiceCategoryForm.vue
index 33c106c..8a02a57 100644
--- a/src/views/services/serviceCategory/components/ConfigServiceCategoryForm.vue
+++ b/src/views/services/serviceCategory/components/ConfigServiceCategoryForm.vue
@@ -6,9 +6,9 @@
name="ConfigServiceCategoryForm">
-
-
+
@@ -17,19 +17,37 @@
+ :disabled="!formData.instructionId || formData.colDisabled" allow-clear>
-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -45,9 +63,10 @@ import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import { getValueType } from '/@/utils';
-import { saveOrUpdate } from '../ConfigServiceCategory.api';
+import { getInfo, saveOrUpdate } from '../ConfigServiceCategory.api';
import { Form } from 'ant-design-vue';
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
+import JImageUploadToOpe from '/@/components/Form/src/jeecg/components/JImageUploadToOpe.vue';
const props = defineProps({
formDisabled: { type: Boolean, default: false },
formData: { type: Object, default: () => ({}) },
@@ -62,6 +81,10 @@ const formData = reactive>({
sort: 99,
izEnabled: '0',
instructionId: '',
+ netFlag: '0',
+ staticPath: '',
+ animationPath: '',
+ colDisabled: false
});
const { createMessage } = useMessage();
const labelCol = ref({ xs: { span: 24 }, sm: { span: 5 } });
@@ -92,14 +115,7 @@ const disabled = computed(() => {
/**
* 新增
*/
-function add() {
- edit({});
-}
-
-/**
- * 编辑
- */
-function edit(record) {
+function add(record) {
nextTick(() => {
resetFields();
const tmpData = {};
@@ -110,9 +126,30 @@ function edit(record) {
})
//赋值
Object.assign(formData, tmpData);
+ formData.colDisabled = false;
});
}
+/**
+ * 编辑
+ */
+function edit(data) {
+ getInfo({id: data.id}).then((record) => {
+ nextTick(() => {
+ resetFields();
+ const tmpData = {};
+ Object.keys(formData).forEach((key) => {
+ if (record.hasOwnProperty(key)) {
+ tmpData[key] = record[key]
+ }
+ })
+ //赋值
+ Object.assign(formData, tmpData);
+ formData.colDisabled = true;
+ });
+ })
+}
+
/**
* 提交数据
*/
diff --git a/src/views/services/serviceCategory/components/ConfigServiceCategoryModal.vue b/src/views/services/serviceCategory/components/ConfigServiceCategoryModal.vue
index c65ab1a..fe1edf4 100644
--- a/src/views/services/serviceCategory/components/ConfigServiceCategoryModal.vue
+++ b/src/views/services/serviceCategory/components/ConfigServiceCategoryModal.vue
@@ -1,13 +1,13 @@
-
@@ -36,11 +36,11 @@ const emit = defineEmits(['register', 'success', 'refresh']);
/**
* 新增
*/
-function add() {
+function add(record) {
title.value = '新增';
visible.value = true;
nextTick(() => {
- registerForm.value.add();
+ registerForm.value.add(record);
});
}
@@ -49,7 +49,7 @@ function add() {
* @param record
*/
function edit(record) {
- title.value = '新增';
+ title.value = '修改';
visible.value = true;
nextTick(() => {
registerForm.value.edit(record);
diff --git a/src/views/services/serviceDirective/ConfigServiceDirectiveList.vue b/src/views/services/serviceDirective/ConfigServiceDirectiveList.vue
index 67d6572..1ef8200 100644
--- a/src/views/services/serviceDirective/ConfigServiceDirectiveList.vue
+++ b/src/views/services/serviceDirective/ConfigServiceDirectiveList.vue
@@ -1071,11 +1071,7 @@ function addInstruction() {
insRegisterModal.value.disableSubmit = false;
insRegisterModal.value.add();
}
-//修改动画图片
-function editAnimationPath(data) {
- // insRegisterModal.value.disableSubmit = false;
- // insRegisterModal.value.edit(data);
-}
+
//启用分类标签
function usingInstruction(data) {
createConfirm({
@@ -1115,7 +1111,7 @@ function editInstruction(data) {
//新增服务类别
function addCategory(data) {
catRegisterModal.value.disableSubmit = false;
- catRegisterModal.value.edit({ instructionId: data.instructionId });
+ catRegisterModal.value.add({ instructionId: data.instructionId });
}
//启用服务类别
function usingCategory(data) {
@@ -1147,10 +1143,15 @@ function stopCategory(data) {
}
});
}
+//修改类别图片
+function editCategoryAnimationPath(data) {
+ catRegisterModal.value.disableSubmit = false;
+ catRegisterModal.value.edit({ id: data.key });
+}
//新增服务类型
function addType(data) {
typRegisterModal.value.disableSubmit = false;
- typRegisterModal.value.edit({ instructionId: data.instructionId, categoryId: data.categoryId });
+ typRegisterModal.value.add({ instructionId: data.instructionId, categoryId: data.categoryId });
}
//启用服务类型
function usingType(data) {
@@ -1180,6 +1181,11 @@ function stopType(data) {
}
});
}
+//修改类别图片
+function editTypeAnimationPath(data) {
+ typRegisterModal.value.disableSubmit = false;
+ typRegisterModal.value.edit({ id: data.key });
+}
//新增服务指令
function addDirective(data) {
registerModal.value.disableSubmit = false;
@@ -1246,9 +1252,9 @@ function menuItems(data) {
} else if (data.izEnabled === '0') {
items.push({ key: 'stopCat', label: '停用服务类别', icon: 'ant-design:stop-outlined', canAdd: data.parentLevelEnabled, action: stopCategory })
}
-
+
if (!!mainOrgCode.value && mainOrgCode.value == ownOrgCode.value) {
- items.push({ key: 'addIns', label: '修改动画', icon: 'ant-design:plus-outlined', canAdd: true && !!mainOrgCode.value && mainOrgCode.value == ownOrgCode.value, action: editAnimationPath },)
+ items.push({ key: 'editCatImg', label: '修改类别图片', icon: 'ant-design:plus-outlined', canAdd: true && !!mainOrgCode.value && mainOrgCode.value == ownOrgCode.value, action: editCategoryAnimationPath },)
}
return items
}
@@ -1264,6 +1270,9 @@ function menuItems(data) {
} else if (data.izEnabled === '0') {
items.push({ key: 'stopTyp', label: '停用服务类型', icon: 'ant-design:stop-outlined', canAdd: data.parentLevelEnabled, action: stopType })
}
+ if (!!mainOrgCode.value && mainOrgCode.value == ownOrgCode.value) {
+ items.push({ key: 'editTypeImg', label: '修改类型图片', icon: 'ant-design:plus-outlined', canAdd: true && !!mainOrgCode.value && mainOrgCode.value == ownOrgCode.value, action: editTypeAnimationPath },)
+ }
return items
}
else if (data.level === 4) {
@@ -1360,7 +1369,7 @@ async function initTree() {
}
/**
- * 查看指令库
+ * 查看指令库
*/
function handleDirectiveMainOpen() {
registerModal.value?.openDM(mainOrgCode.value)
diff --git a/src/views/services/serviceType/ConfigServiceType.api.ts b/src/views/services/serviceType/ConfigServiceType.api.ts
index f8e9dfe..3507bff 100644
--- a/src/views/services/serviceType/ConfigServiceType.api.ts
+++ b/src/views/services/serviceType/ConfigServiceType.api.ts
@@ -7,6 +7,7 @@ enum Api {
list = '/services/ServiceType/configServiceType/list',
save='/services/ServiceType/configServiceType/add',
edit='/services/ServiceType/configServiceType/edit',
+ getInfo = '/services/ServiceType/configServiceType/getInfo',
deleteOne = '/services/ServiceType/configServiceType/delete',
deleteBatch = '/services/ServiceType/configServiceType/deleteBatch',
importExcel = '/services/ServiceType/configServiceType/importExcel',
@@ -31,6 +32,8 @@ export const getImportUrl = Api.importExcel;
*/
export const list = (params) => defHttp.get({ url: Api.list, params });
+export const getInfo = (params) => defHttp.get({ url: Api.getInfo, params });
+
/**
* 删除单个
* @param params
diff --git a/src/views/services/serviceType/components/ConfigServiceTypeForm.vue b/src/views/services/serviceType/components/ConfigServiceTypeForm.vue
index 0f173ac..cfe0396 100644
--- a/src/views/services/serviceType/components/ConfigServiceTypeForm.vue
+++ b/src/views/services/serviceType/components/ConfigServiceTypeForm.vue
@@ -8,7 +8,7 @@
-
@@ -17,28 +17,45 @@
+ placeholder="请选择服务类别" allowClear :disabled="!formData.instructionId || formData.colDisabled" />
+ :showCount="true" :disabled="!formData.categoryId || formData.colDisabled">
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -52,9 +69,10 @@ import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import { getValueType } from '/@/utils';
-import { saveOrUpdate } from '../ConfigServiceType.api';
+import { getInfo, saveOrUpdate } from '../ConfigServiceType.api';
import { Form } from 'ant-design-vue';
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
+import JImageUploadToOpe from '/@/components/Form/src/jeecg/components/JImageUploadToOpe.vue';
const props = defineProps({
formDisabled: { type: Boolean, default: false },
@@ -71,6 +89,10 @@ const formData = reactive>({
typeName: '',
sort: 99,
izEnabled: '0',
+ netFlag: '0',
+ staticPath: '',
+ animationPath: '',
+ colDisabled: false
});
const { createMessage } = useMessage();
const labelCol = ref({ xs: { span: 24 }, sm: { span: 5 } });
@@ -117,14 +139,7 @@ const disabled = computed(() => {
/**
* 新增
*/
-function add() {
- edit({});
-}
-
-/**
- * 编辑
- */
-function edit(record) {
+function add(record) {
nextTick(() => {
resetFields();
const tmpData = {};
@@ -135,9 +150,30 @@ function edit(record) {
});
//赋值
Object.assign(formData, tmpData);
+ formData.colDisabled = false;
});
}
+/**
+ * 编辑
+ */
+function edit(data) {
+ getInfo({id: data.id}).then((record) => {
+ nextTick(() => {
+ resetFields();
+ const tmpData = {};
+ Object.keys(formData).forEach((key) => {
+ if (record.hasOwnProperty(key)) {
+ tmpData[key] = record[key]
+ }
+ })
+ //赋值
+ Object.assign(formData, tmpData);
+ formData.colDisabled = true;
+ });
+ })
+}
+
/**
* 提交数据
*/
@@ -213,4 +249,4 @@ defineExpose({
.antd-modal-form {
padding: 14px;
}
-
\ No newline at end of file
+
diff --git a/src/views/services/serviceType/components/ConfigServiceTypeModal.vue b/src/views/services/serviceType/components/ConfigServiceTypeModal.vue
index 8f8adb6..5d220ca 100644
--- a/src/views/services/serviceType/components/ConfigServiceTypeModal.vue
+++ b/src/views/services/serviceType/components/ConfigServiceTypeModal.vue
@@ -34,11 +34,11 @@ const emit = defineEmits(['register', 'success', 'refresh']);
/**
* 新增
*/
-function add() {
+function add(record) {
title.value = '新增';
visible.value = true;
nextTick(() => {
- registerForm.value.add();
+ registerForm.value.add(record);
});
}
@@ -47,8 +47,7 @@ function add() {
* @param record
*/
function edit(record) {
- // title.value = disableSubmit.value ? '详情' : '编辑';
- title.value = '新增';
+ title.value = '修改';
visible.value = true;
nextTick(() => {
registerForm.value.edit(record);