product category
This commit is contained in:
@ -9,7 +9,8 @@
|
|||||||
"build:prod": "vite build",
|
"build:prod": "vite build",
|
||||||
"build:stage": "vite build --mode staging",
|
"build:stage": "vite build --mode staging",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"fmt": "prettier -w ."
|
"fmt": "prettier -w .",
|
||||||
|
"commit-push": "prettier -w . && git add . && git commit -m"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
@ -27,6 +27,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import { ref } from "vue";
|
||||||
|
|
||||||
const activeIndex = ref(0);
|
const activeIndex = ref(0);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@ -11,6 +11,7 @@
|
|||||||
<el-tab-pane label="密码登录" name="password"></el-tab-pane>
|
<el-tab-pane label="密码登录" name="password"></el-tab-pane>
|
||||||
<el-tab-pane label="验证码登录" name="captcha"></el-tab-pane>
|
<el-tab-pane label="验证码登录" name="captcha"></el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
|
<Transition> </Transition>
|
||||||
<div v-if="loginMethod === 'password'">
|
<div v-if="loginMethod === 'password'">
|
||||||
<el-form-item prop="username">
|
<el-form-item prop="username">
|
||||||
<el-input
|
<el-input
|
||||||
@ -319,6 +320,7 @@ getCookie();
|
|||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
width: 400px;
|
width: 400px;
|
||||||
padding: 25px 25px 5px 25px;
|
padding: 25px 25px 5px 25px;
|
||||||
|
transition: all 1s linear;
|
||||||
box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1),
|
box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1),
|
||||||
0 8px 10px -6px rgb(0 0 0 / 0.1);
|
0 8px 10px -6px rgb(0 0 0 / 0.1);
|
||||||
|
|
||||||
|
|||||||
@ -8,14 +8,14 @@
|
|||||||
label-position="left"
|
label-position="left"
|
||||||
label-width="100px"
|
label-width="100px"
|
||||||
>
|
>
|
||||||
<el-form-item label="父ID" prop="parentId">
|
<!-- <el-form-item label="父ID" prop="parentId">-->
|
||||||
<el-input
|
<!-- <el-input-->
|
||||||
v-model="queryParams.parentId"
|
<!-- v-model="queryParams.parentId"-->
|
||||||
clearable
|
<!-- clearable-->
|
||||||
placeholder="请输入父ID"
|
<!-- placeholder="请输入父ID"-->
|
||||||
@keyup.enter="handleQuery"
|
<!-- @keyup.enter="handleQuery"-->
|
||||||
/>
|
<!-- />-->
|
||||||
</el-form-item>
|
<!-- </el-form-item>-->
|
||||||
<el-form-item label="物品分类名称" prop="name">
|
<el-form-item label="物品分类名称" prop="name">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.name"
|
v-model="queryParams.name"
|
||||||
@ -24,22 +24,22 @@
|
|||||||
@keyup.enter="handleQuery"
|
@keyup.enter="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="排序" prop="sort">
|
<!-- <el-form-item label="排序" prop="sort">-->
|
||||||
<el-input
|
<!-- <el-input-->
|
||||||
v-model="queryParams.sort"
|
<!-- v-model="queryParams.sort"-->
|
||||||
clearable
|
<!-- clearable-->
|
||||||
placeholder="请输入排序"
|
<!-- placeholder="请输入排序"-->
|
||||||
@keyup.enter="handleQuery"
|
<!-- @keyup.enter="handleQuery"-->
|
||||||
/>
|
<!-- />-->
|
||||||
</el-form-item>
|
<!-- </el-form-item>-->
|
||||||
<el-form-item label="租户ID" prop="tenantId">
|
<!-- <el-form-item label="租户ID" prop="tenantId">-->
|
||||||
<el-input
|
<!-- <el-input-->
|
||||||
v-model="queryParams.tenantId"
|
<!-- v-model="queryParams.tenantId"-->
|
||||||
clearable
|
<!-- clearable-->
|
||||||
placeholder="请输入租户ID"
|
<!-- placeholder="请输入租户ID"-->
|
||||||
@keyup.enter="handleQuery"
|
<!-- @keyup.enter="handleQuery"-->
|
||||||
/>
|
<!-- />-->
|
||||||
</el-form-item>
|
<!-- </el-form-item>-->
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button icon="Search" type="primary" @click="handleQuery"
|
<el-button icon="Search" type="primary" @click="handleQuery"
|
||||||
>搜索</el-button
|
>搜索</el-button
|
||||||
@ -105,13 +105,13 @@
|
|||||||
@selection-change="handleSelectionChange"
|
@selection-change="handleSelectionChange"
|
||||||
>
|
>
|
||||||
<el-table-column align="center" type="selection" width="55" />
|
<el-table-column align="center" type="selection" width="55" />
|
||||||
<el-table-column align="center" label="物品分类ID" prop="categoryId" />
|
<!-- <el-table-column align="center" label="物品分类ID" prop="categoryId" />-->
|
||||||
<el-table-column align="center" label="父ID" prop="parentId" />
|
<!-- <el-table-column align="center" label="父ID" prop="parentId" />-->
|
||||||
<el-table-column align="center" label="物品分类名称" prop="name" />
|
<el-table-column align="center" label="物品分类名称" prop="name" />
|
||||||
<el-table-column align="center" label="排序" prop="sort" />
|
<!-- <el-table-column align="center" label="排序" prop="sort" />-->
|
||||||
<el-table-column align="center" label="备注" prop="remark" />
|
<el-table-column align="center" label="备注" prop="remark" />
|
||||||
<el-table-column align="center" label="状态(0正常1禁用)" prop="status" />
|
<!-- <el-table-column align="center" label="状态(0正常1禁用)" prop="status" />-->
|
||||||
<el-table-column align="center" label="租户ID" prop="tenantId" />
|
<!-- <el-table-column align="center" label="租户ID" prop="tenantId" />-->
|
||||||
<el-table-column
|
<el-table-column
|
||||||
align="center"
|
align="center"
|
||||||
class-name="small-padding fixed-width"
|
class-name="small-padding fixed-width"
|
||||||
@ -140,19 +140,19 @@
|
|||||||
link
|
link
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="handleAdd(scope.row.categoryId)"
|
@click="handleAdd(scope.row.categoryId)"
|
||||||
>添加子级
|
>添加子节点
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination
|
<!-- <pagination-->
|
||||||
v-show="total > 0"
|
<!-- v-show="total>0"-->
|
||||||
v-model:limit="queryParams.pageSize"
|
<!-- v-model:limit="queryParams.pageSize"-->
|
||||||
v-model:page="queryParams.pageNum"
|
<!-- v-model:page="queryParams.pageNum"-->
|
||||||
:total="total"
|
<!-- :total="total"-->
|
||||||
@pagination="getList"
|
<!-- @pagination="getList"-->
|
||||||
/>
|
<!-- />-->
|
||||||
|
|
||||||
<!-- 添加或修改产品分类对话框 -->
|
<!-- 添加或修改产品分类对话框 -->
|
||||||
<el-dialog v-model="open" :title="title" append-to-body width="500px">
|
<el-dialog v-model="open" :title="title" append-to-body width="500px">
|
||||||
@ -163,27 +163,36 @@
|
|||||||
label-position="left"
|
label-position="left"
|
||||||
label-width="120px"
|
label-width="120px"
|
||||||
>
|
>
|
||||||
<el-form-item label="选择父级" prop="parentId">
|
<el-form-item label="物品分类名称" prop="name">
|
||||||
<!-- <el-input v-model="form.parentId" placeholder="请输入父ID"/>-->
|
<el-input v-model="form.name" placeholder="请输入物品分类名称" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="选择上级" prop="parentId">
|
||||||
|
<!-- <el-input v-model="form.parentId" placeholder="请输入父ID" />-->
|
||||||
<el-tree-select
|
<el-tree-select
|
||||||
v-model="form.parentId"
|
v-model="form.parentId"
|
||||||
:data="categoryList"
|
:data="[
|
||||||
|
{
|
||||||
|
categoryId: 0,
|
||||||
|
name: '根节点',
|
||||||
|
children: categoryList,
|
||||||
|
},
|
||||||
|
]"
|
||||||
|
:default-expanded-keys="[0]"
|
||||||
|
node-key="categoryId"
|
||||||
:props="{
|
:props="{
|
||||||
value: 'categoryId',
|
value: 'categoryId',
|
||||||
label: 'name',
|
label: 'name',
|
||||||
children: 'children',
|
children: 'children',
|
||||||
}"
|
}"
|
||||||
check-strictly
|
check-strictly
|
||||||
placeholder="选择父级"
|
clearable
|
||||||
|
placeholder="选择上级分类"
|
||||||
value-key="categoryId"
|
value-key="categoryId"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="物品分类名称" prop="name">
|
<!-- <el-form-item label="排序" prop="sort">-->
|
||||||
<el-input v-model="form.name" placeholder="请输入物品分类名称" />
|
<!-- <el-input v-model="form.sort" placeholder="请输入排序" />-->
|
||||||
</el-form-item>
|
<!-- </el-form-item>-->
|
||||||
<el-form-item label="排序" prop="sort">
|
|
||||||
<el-input v-model="form.sort" placeholder="请输入排序" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="备注" prop="remark">
|
<el-form-item label="备注" prop="remark">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="form.remark"
|
v-model="form.remark"
|
||||||
@ -191,9 +200,9 @@
|
|||||||
type="textarea"
|
type="textarea"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="租户ID" prop="tenantId">
|
<!-- <el-form-item label="租户ID" prop="tenantId">-->
|
||||||
<el-input v-model="form.tenantId" placeholder="请输入租户ID" />
|
<!-- <el-input v-model="form.tenantId" placeholder="请输入租户ID" />-->
|
||||||
</el-form-item>
|
<!-- </el-form-item>-->
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="dialog-footer">
|
<div class="dialog-footer">
|
||||||
@ -230,15 +239,17 @@ const title = ref("");
|
|||||||
const data = reactive({
|
const data = reactive({
|
||||||
form: {},
|
form: {},
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
// pageNum: 1,
|
||||||
pageSize: 10,
|
// pageSize: 10,
|
||||||
parentId: null,
|
parentId: null,
|
||||||
name: null,
|
name: null,
|
||||||
sort: null,
|
sort: null,
|
||||||
status: null,
|
status: null,
|
||||||
tenantId: null,
|
tenantId: null,
|
||||||
},
|
},
|
||||||
rules: {},
|
rules: {
|
||||||
|
name: [{ required: true, message: "请输入产品分类名称", trigger: "blur" }],
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const { queryParams, form, rules } = toRefs(data);
|
const { queryParams, form, rules } = toRefs(data);
|
||||||
@ -247,8 +258,8 @@ const { queryParams, form, rules } = toRefs(data);
|
|||||||
function getList() {
|
function getList() {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
listCategory(queryParams.value).then((response) => {
|
listCategory(queryParams.value).then((response) => {
|
||||||
categoryList.value = response.rows;
|
categoryList.value = response.data;
|
||||||
total.value = response.total;
|
// total.value = response.total;
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -263,7 +274,7 @@ function cancel() {
|
|||||||
function reset() {
|
function reset() {
|
||||||
form.value = {
|
form.value = {
|
||||||
categoryId: null,
|
categoryId: null,
|
||||||
parentId: null,
|
parentId: 0,
|
||||||
name: null,
|
name: null,
|
||||||
sort: null,
|
sort: null,
|
||||||
remark: null,
|
remark: null,
|
||||||
@ -277,7 +288,7 @@ function reset() {
|
|||||||
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
function handleQuery() {
|
function handleQuery() {
|
||||||
queryParams.value.pageNum = 1;
|
// queryParams.value.pageNum = 1;
|
||||||
getList();
|
getList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -262,6 +262,7 @@ getCode();
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
span {
|
span {
|
||||||
display: block;
|
display: block;
|
||||||
width: calc(32px / 39 * 157);
|
width: calc(32px / 39 * 157);
|
||||||
|
|||||||
@ -31,7 +31,7 @@ export default defineConfig(({ mode, command }) => {
|
|||||||
proxy: {
|
proxy: {
|
||||||
// https://cn.vitejs.dev/config/#server-proxy
|
// https://cn.vitejs.dev/config/#server-proxy
|
||||||
"/dev-api": {
|
"/dev-api": {
|
||||||
target: "http://192.168.1.16:1616",
|
target: "http://192.168.1.5:1616",
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
rewrite: (p) => p.replace(/^\/dev-api/, ""),
|
rewrite: (p) => p.replace(/^\/dev-api/, ""),
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user