+
diff --git a/src/views/product/product/components/edit.vue b/src/views/product/product/components/edit.vue
index bc50f6f..a632425 100644
--- a/src/views/product/product/components/edit.vue
+++ b/src/views/product/product/components/edit.vue
@@ -32,11 +32,18 @@
-
-
+
+
-
-
+
-
+
@@ -87,15 +97,18 @@
/>
-
-
+
+
-
-
-
@@ -105,19 +118,29 @@
-
- 提交
+
+ 提交
-
-
+
+
-
-
-
-
+
+
+
+
@@ -126,7 +149,12 @@
import { onMounted, reactive, ref, toRefs } from "vue";
import Model from "@/views/product/product/components/model.vue";
import { useRoute } from "vue-router";
-import { addProduct, checkProductSn, getProduct, updateProduct } from "@/api/product/product";
+import {
+ addProduct,
+ checkProductSn,
+ getProduct,
+ updateProduct,
+} from "@/api/product/product";
import { listCategory } from "@/api/product/category";
import { listTenant } from "@/api/system/tenant";
import ImageUpload from "@/components/ImageUpload/index.vue";
@@ -140,26 +168,24 @@ const data = reactive({
form: {},
rules: {
productName: [
- { required: true, message: "产品名称不能为空", trigger: "blur" }
+ { required: true, message: "产品名称不能为空", trigger: "blur" },
],
categoryId: [
- { required: true, message: "产品分类ID不能为空", trigger: "blur" }
+ { required: true, message: "产品分类ID不能为空", trigger: "blur" },
],
- tenantId: [{ required: true, message: "租户ID不能为空", trigger: "blur" }]
- }
+ tenantId: [{ required: true, message: "租户ID不能为空", trigger: "blur" }],
+ },
});
const { form, rules } = toRefs(data);
const productRef = ref();
-const categoryOptions = ref([]); // 产品分类树形选择
+const categoryOptions = ref([]); // 产品分类树形选择
const tenantOptions = ref([]);
const isProductSnUnique = ref();
-
-
const checkProductSnUnique = debounce((sn) => {
console.log(sn);
- checkProductSn(sn).then(response => {
+ checkProductSn(sn).then((response) => {
console.log(response);
isProductSnUnique.value = response.empty;
});
@@ -183,7 +209,7 @@ function reset() {
imgUrl: null,
createBy: null,
createTime: null,
- remark: null
+ remark: null,
};
// proxy.resetForm("productRef");
if (productRef.value) {
@@ -213,7 +239,9 @@ const getCategoryList = async () => {
const getTenantList = async (keyword) => {
const response = await listTenant({
- pageNum: 1, pageSize: 20, tenantName: keyword
+ pageNum: 1,
+ pageSize: 20,
+ tenantName: keyword,
});
tenantOptions.value = response.rows;
};
@@ -229,8 +257,10 @@ const submitForm = () => {
addProduct(form.value).then((response) => {
ElMessage.success("新增成功");
form.value = response.data;
- const tabObj = Object.assign({}, route, { title: "修改产品" });
- tab.updatePage(tabObj);
+ // const tabObj = Object.assign({}, route, { title: "修改产品" });
+ // tab.updatePage(tabObj);
+ const tabObj = { path: "/produc/product" };
+ tab.closeOpenPage(tabObj);
});
}
}
diff --git a/src/views/product/product/components/model.vue b/src/views/product/product/components/model.vue
index 4769457..7b7f0f4 100644
--- a/src/views/product/product/components/model.vue
+++ b/src/views/product/product/components/model.vue
@@ -3,93 +3,299 @@
新增
+ @click="handleAdd"
+ >新增
+
+
+
+ 导入
新增
-
-
-
- 新增
+ @click="emits('model-updated')"
+ >刷新
新增
+ @click="openJsonViewer = true"
+ >预览
-
+
-
-
- {{ isTopMap.get(row.isTop) ?? "未知" }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 事件
+ 功能
+ 属性
+ 未知
-
-
- {{ isMonitor.get(row.isMonitor) ?? "未知" }}
+
+
+
-
- 事件
- 函数
- 属性
- 未知
+
+ 修改
+
+ 删除
+
-
-
-
-
+
+
+
+
-
-
+
+
- 属性
- 功能
- 事件
+ 属性
+ 功能
+ 事件
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 到
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ (0 值对应文本)
+
+
+
+
+
+ (1 值对应文本)
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+ (字符串的最大长度)
+
+
+
+
+
+
+
+ int(整数)
+ double(小数)
+ string(字符串)
+
+
+
+
+
+
+
+
+
+
+ 复制
+
@@ -97,43 +303,381 @@
diff --git a/src/views/product/product/index.vue b/src/views/product/product/index.vue
index 3618652..b730678 100644
--- a/src/views/product/product/index.vue
+++ b/src/views/product/product/index.vue
@@ -82,7 +82,7 @@