更新到老师项目
parent
f4407b9c83
commit
d6c70f139a
|
@ -69,17 +69,9 @@ export function genCode(tableName) {
|
|||
}
|
||||
|
||||
// 同步数据库
|
||||
export function synchDb(tableName,databaseName) {
|
||||
export function synchDb(tableName) {
|
||||
return request({
|
||||
url: '/code/gen/synchDb/' + tableName + '/' + databaseName,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询db数据库
|
||||
export function getDataBaseList() {
|
||||
return request({
|
||||
url: '/code/gen/db/getDataBaseList',
|
||||
url: '/code/gen/synchDb/' + tableName,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
|
|
@ -9,23 +9,6 @@
|
|||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="更新人" prop="updatedBy">
|
||||
<el-input
|
||||
v-model="queryParams.updatedBy"
|
||||
placeholder="请输入更新人"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间" prop="updatedTime">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.updatedTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择更新时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
|
@ -80,15 +63,9 @@
|
|||
|
||||
<el-table v-loading="loading" :data="attributeList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="属性编号" align="center" prop="id" />
|
||||
<el-table-column label="属性编码" align="center" prop="code" />
|
||||
<el-table-column label="属性名" align="center" prop="name" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="更新人" align="center" prop="updatedBy" />
|
||||
<el-table-column label="更新时间" align="center" prop="updatedTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.updatedTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
|
@ -118,37 +95,17 @@
|
|||
/>
|
||||
|
||||
<!-- 添加或修改商品属性对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-dialog :title="title" :visible.sync="open" width="80%" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="属性编码" prop="code">
|
||||
<el-input v-model="form.code" placeholder="请输入属性编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="属性名" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入属性名" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人" prop="createdBy">
|
||||
<el-input v-model="form.createdBy" placeholder="请输入创建人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createdTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.createdTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择创建时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人" prop="updatedBy">
|
||||
<el-input v-model="form.updatedBy" placeholder="请输入更新人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间" prop="updatedTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.updatedTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择更新时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
|
@ -187,20 +144,19 @@ export default {
|
|||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: null,
|
||||
updatedBy: null,
|
||||
updatedTime: null
|
||||
code: null,
|
||||
name: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
code: [
|
||||
{ required: true, message: "属性编码不能为空", trigger: "blur" }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: "属性名不能为空", trigger: "blur" }
|
||||
],
|
||||
createdTime: [
|
||||
{ required: true, message: "创建时间不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
|
@ -226,12 +182,11 @@ export default {
|
|||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
code: null,
|
||||
name: null,
|
||||
remark: null,
|
||||
createdBy: null,
|
||||
createdTime: null,
|
||||
updatedBy: null,
|
||||
updatedTime: null
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
remark: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
|
|
|
@ -19,22 +19,6 @@
|
|||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人" prop="updatedBy">
|
||||
<el-input
|
||||
v-model="queryParams.updatedBy"
|
||||
placeholder="请输入更新人"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间" prop="updatedTime">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.updatedTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择更新时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
|
@ -89,20 +73,20 @@
|
|||
|
||||
<el-table v-loading="loading" :data="attributeGroupList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="属性组编号" align="center" prop="id" />
|
||||
<el-table-column label="组名称" align="center" prop="name" />
|
||||
<el-table-column label="组内属性" align="center" prop="attributeInfoList" >
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-for="attributeInfo in scope.row.attributeInfoList">
|
||||
{{attributeInfo.name}}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="states">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.states"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="更新人" align="center" prop="updatedBy" />
|
||||
<el-table-column label="更新时间" align="center" prop="updatedTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.updatedTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
|
@ -132,11 +116,15 @@
|
|||
/>
|
||||
|
||||
<!-- 添加或修改属性组对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-dialog :title="title" :visible.sync="open" width="80%" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="组名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入组名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="状态" prop="states">
|
||||
<el-radio-group v-model="form.states">
|
||||
<el-radio
|
||||
|
@ -146,31 +134,14 @@
|
|||
>{{dict.label}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人" prop="createdBy">
|
||||
<el-input v-model="form.createdBy" placeholder="请输入创建人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createdTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.createdTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择创建时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人" prop="updatedBy">
|
||||
<el-input v-model="form.updatedBy" placeholder="请输入更新人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间" prop="updatedTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.updatedTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择更新时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<CheckAttribute v-model="form.attributeIdList"/>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
|
@ -211,9 +182,7 @@ export default {
|
|||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: null,
|
||||
states: null,
|
||||
updatedBy: null,
|
||||
updatedTime: null
|
||||
states: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
|
@ -232,6 +201,7 @@ export default {
|
|||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
|
||||
/** 查询属性组列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
|
@ -253,11 +223,9 @@ export default {
|
|||
name: null,
|
||||
states: null,
|
||||
remark: null,
|
||||
createdBy: null,
|
||||
createdTime: null,
|
||||
updatedBy: null,
|
||||
updatedTime: null
|
||||
attributeIdList: [],
|
||||
};
|
||||
this.checkedAttributeList = []
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="品牌名称" prop="name">
|
||||
<el-form-item label="品牌名称" prop="nam">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
v-model="queryParams.nam"
|
||||
placeholder="请输入品牌名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否启用" prop="stauts">
|
||||
<el-select v-model="queryParams.stauts" placeholder="请选择是否启用" clearable>
|
||||
<el-form-item label="是否启用" prop="start">
|
||||
<el-select v-model="queryParams.start" placeholder="请选择是否启用" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.sys_yes_no"
|
||||
:key="dict.value"
|
||||
|
@ -74,18 +74,18 @@
|
|||
<el-table v-loading="loading" :data="brandList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="主键" align="center" prop="id" />
|
||||
<el-table-column label="品牌名称" align="center" prop="name" />
|
||||
<el-table-column label="Logo" align="center" prop="logo" width="100">
|
||||
<el-table-column label="品牌名称" align="center" prop="nam" />
|
||||
<el-table-column label="LOGO" align="center" prop="logo" width="100">
|
||||
<template slot-scope="scope">
|
||||
<image-preview :src="scope.row.logo" :width="50" :height="50"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="介绍" align="center" prop="introduction" />
|
||||
<el-table-column label="是否启用" align="center" prop="stauts">
|
||||
<el-table-column label="是否启用" align="center" prop="start">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.stauts"/>
|
||||
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.start"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="介绍" align="center" prop="introduction" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
|
@ -116,19 +116,16 @@
|
|||
/>
|
||||
|
||||
<!-- 添加或修改品牌信息对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-dialog :title="title" :visible.sync="open" width="80%" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="品牌名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入品牌名称" />
|
||||
<el-form-item label="品牌名称" prop="nam">
|
||||
<el-input v-model="form.nam" placeholder="请输入品牌名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="Logo" prop="logo">
|
||||
<image-upload v-model="form.logo" :limit="1" :is-show-tip="false" />
|
||||
<el-form-item label="LOGO" prop="logo">
|
||||
<image-upload v-model="form.logo" :limit="1" :is-show-tip="false"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="介绍">
|
||||
<editor v-model="form.introduction" :min-height="192"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否启用" prop="stauts">
|
||||
<el-radio-group v-model="form.stauts">
|
||||
<el-form-item label="是否启用" prop="start">
|
||||
<el-radio-group v-model="form.start">
|
||||
<el-radio
|
||||
v-for="dict in dict.type.sys_yes_no"
|
||||
:key="dict.value"
|
||||
|
@ -136,31 +133,12 @@
|
|||
>{{dict.label}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="介绍">
|
||||
<editor v-model="form.introduction" :min-height="192"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人" prop="createdBy">
|
||||
<el-input v-model="form.createdBy" placeholder="请输入创建人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createdTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.createdTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择创建时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人" prop="updatedBy">
|
||||
<el-input v-model="form.updatedBy" placeholder="请输入更新人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间" prop="updatedTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.updatedTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择更新时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
|
@ -200,25 +178,34 @@ export default {
|
|||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: null,
|
||||
nam: null,
|
||||
logo: null,
|
||||
start: null,
|
||||
introduction: null,
|
||||
stauts: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
createdBy: [
|
||||
nam: [
|
||||
{ required: true, message: "品牌名称不能为空", trigger: "blur" }
|
||||
],
|
||||
logo: [
|
||||
{ required: true, message: "LOGO不能为空", trigger: "blur" }
|
||||
],
|
||||
start: [
|
||||
{ required: true, message: "是否启用不能为空", trigger: "change" }
|
||||
],
|
||||
createBy: [
|
||||
{ required: true, message: "创建人不能为空", trigger: "blur" }
|
||||
],
|
||||
createdTime: [
|
||||
createTime: [
|
||||
{ required: true, message: "创建时间不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() { //把1删掉就好了
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
|
@ -240,15 +227,15 @@ export default {
|
|||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
name: null,
|
||||
nam: null,
|
||||
logo: null,
|
||||
start: null,
|
||||
introduction: null,
|
||||
stauts: null,
|
||||
remark: null,
|
||||
createdBy: null,
|
||||
createdTime: null,
|
||||
updatedBy: null,
|
||||
updatedTime: null
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否启用" prop="stauts">
|
||||
<el-form-item label="是否启用" prop="start">
|
||||
<el-input
|
||||
v-model="queryParams.stauts"
|
||||
v-model="queryParams.start"
|
||||
placeholder="请输入是否启用"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
|
@ -69,9 +69,9 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="父级品类" align="center" prop="parentId" />
|
||||
<el-table-column label="是否启用" align="center" prop="stauts">
|
||||
<el-table-column label="是否启用" align="center" prop="start">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.stauts"/>
|
||||
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.start"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="介绍" align="center" prop="introduction" />
|
||||
|
@ -104,48 +104,62 @@
|
|||
</el-table>
|
||||
|
||||
<!-- 添加或修改品类信息对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-dialog :title="title" :visible.sync="open" width="80%" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="品类名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入品类名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="图片" prop="image">
|
||||
<image-upload v-model="form.image"/>
|
||||
</el-form-item>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="父级品类" prop="parentId">
|
||||
<treeselect v-model="form.parentId" :options="categoryOptions" :normalizer="normalizer" placeholder="请选择父级品类" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否启用" prop="stauts">
|
||||
<el-input v-model="form.stauts" placeholder="请输入是否启用" />
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="品类名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入品类名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="介绍">
|
||||
<editor v-model="form.introduction" :min-height="192"/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否启用" prop="start">
|
||||
<el-radio-group v-model="form.start">
|
||||
<el-radio
|
||||
v-for="dict in dict.type.sys_yes_no"
|
||||
:key="dict.value"
|
||||
:label="dict.value"
|
||||
>{{dict.label}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人" prop="createdBy">
|
||||
<el-input v-model="form.createdBy" placeholder="请输入创建人" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="图片" prop="image">
|
||||
<image-upload v-model="form.image" :limit="1" :is-show-tip="false"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createdTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.createdTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择创建时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人" prop="updatedBy">
|
||||
<el-input v-model="form.updatedBy" placeholder="请输入更新人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间" prop="updatedTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.updatedTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择更新时间">
|
||||
</el-date-picker>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="介绍">
|
||||
<editor v-model="form.introduction" :min-height="80"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-tabs value="attribute" type="card" >
|
||||
<el-tab-pane label="商品属性" name="attribute">
|
||||
<CheckAttribute v-model="form.attributeIdList" :checked-list="attributeInfoList"/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="商品属性组" name="attributeGroup">
|
||||
<CheckAttributeGroup v-model="form.attributeGroupIdList" :checked-list="attributeGroupList"/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="商品品牌" name="brand">
|
||||
<CheckBrand v-model="form.brandIdList" :checked-list="brandInfoList"/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
|
@ -156,12 +170,20 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { listCategory, getCategory, delCategory, addCategory, updateCategory } from "@/api/product/category";
|
||||
import {
|
||||
listCategory,
|
||||
getCategory,
|
||||
delCategory,
|
||||
addCategory,
|
||||
updateCategory,
|
||||
parentCommonElement
|
||||
} from "@/api/product/category";
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
|
||||
export default {
|
||||
name: "Category",
|
||||
dicts: ['sys_yes_no'],
|
||||
components: {
|
||||
Treeselect
|
||||
},
|
||||
|
@ -188,7 +210,7 @@ export default {
|
|||
name: null,
|
||||
image: null,
|
||||
parentId: null,
|
||||
stauts: null,
|
||||
start: null,
|
||||
introduction: null,
|
||||
},
|
||||
// 表单参数
|
||||
|
@ -204,18 +226,35 @@ export default {
|
|||
parentId: [
|
||||
{ required: true, message: "父级品类不能为空", trigger: "blur" }
|
||||
],
|
||||
stauts: [
|
||||
start: [
|
||||
{ required: true, message: "是否启用不能为空", trigger: "blur" }
|
||||
],
|
||||
createdBy: [
|
||||
createBy: [
|
||||
{ required: true, message: "创建人不能为空", trigger: "blur" }
|
||||
],
|
||||
createdTime: [
|
||||
createTime: [
|
||||
{ required: true, message: "创建时间不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
},
|
||||
attributeInfoList: [],
|
||||
attributeGroupList: [],
|
||||
brandInfoList: [],
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
'form.parentId': {
|
||||
handler(val){
|
||||
if (val !== undefined && val !== 0){
|
||||
parentCommonElement(val).then(response => {
|
||||
this.attributeInfoList = response.data.attributeInfoList;
|
||||
this.attributeGroupList = response.data.attributeGroupList;
|
||||
this.brandInfoList = response.data.brandInfoList;
|
||||
})
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
|
@ -260,13 +299,13 @@ export default {
|
|||
name: null,
|
||||
image: null,
|
||||
parentId: null,
|
||||
stauts: null,
|
||||
start: null,
|
||||
introduction: null,
|
||||
remark: null,
|
||||
createdBy: null,
|
||||
createdTime: null,
|
||||
updatedBy: null,
|
||||
updatedTime: null
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
|
|
|
@ -80,7 +80,7 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="父类id" align="center" prop="parentId" />
|
||||
<el-table-column label="备注" align="center" prop="rmark" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
|
@ -110,7 +110,7 @@
|
|||
/>
|
||||
|
||||
<!-- 添加或修改商品评论对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-dialog :title="title" :visible.sync="open" width="80%" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="商品id" prop="projectId">
|
||||
<el-input v-model="form.projectId" placeholder="请输入商品id" />
|
||||
|
@ -124,30 +124,8 @@
|
|||
<el-form-item label="父类id" prop="parentId">
|
||||
<el-input v-model="form.parentId" placeholder="请输入父类id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="rmark">
|
||||
<el-input v-model="form.rmark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人" prop="createdBy">
|
||||
<el-input v-model="form.createdBy" placeholder="请输入创建人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createdTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.createdTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择创建时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人" prop="updatedBy">
|
||||
<el-input v-model="form.updatedBy" placeholder="请输入更新人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间" prop="updatedTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.updatedTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择更新时间">
|
||||
</el-date-picker>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
|
@ -199,13 +177,10 @@ export default {
|
|||
projectId: [
|
||||
{ required: true, message: "商品id不能为空", trigger: "blur" }
|
||||
],
|
||||
parentId: [
|
||||
{ required: true, message: "父类id不能为空", trigger: "blur" }
|
||||
],
|
||||
createdBy: [
|
||||
createBy: [
|
||||
{ required: true, message: "创建人不能为空", trigger: "blur" }
|
||||
],
|
||||
createdTime: [
|
||||
createTime: [
|
||||
{ required: true, message: "创建时间不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
|
@ -237,11 +212,11 @@ export default {
|
|||
comment: null,
|
||||
images: null,
|
||||
parentId: null,
|
||||
rmark: null,
|
||||
createdBy: null,
|
||||
createdTime: null,
|
||||
updatedBy: null,
|
||||
updatedTime: null
|
||||
remark: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
|
|
|
@ -9,14 +9,6 @@
|
|||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="父类型" prop="parent">
|
||||
<el-input
|
||||
v-model="queryParams.parent"
|
||||
placeholder="请输入父类型"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择商品状态" clearable>
|
||||
<el-option
|
||||
|
@ -101,7 +93,7 @@
|
|||
<el-table-column label="商品名称" align="center" prop="name" />
|
||||
<el-table-column label="商品描述" align="center" prop="introduction" />
|
||||
<el-table-column label="主类型" align="center" prop="mianType" />
|
||||
<el-table-column label="父类型" align="center" prop="parent" />
|
||||
<el-table-column label="父类型" align="center" prop="parentType" />
|
||||
<el-table-column label="商品类型" align="center" prop="type" />
|
||||
<el-table-column label="商品图片" align="center" prop="image" width="100">
|
||||
<template slot-scope="scope">
|
||||
|
@ -150,65 +142,221 @@
|
|||
/>
|
||||
|
||||
<!-- 添加或修改商品信息对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-dialog :title="title" :visible.sync="open" width="80%" append-to-body>
|
||||
<el-steps :active="stepNumber" finish-status="success">
|
||||
<el-step title="基本信息"></el-step>
|
||||
<el-step title="品类属性"></el-step>
|
||||
<el-step title="商品规格"></el-step>
|
||||
<el-step title="商品描述"></el-step>
|
||||
</el-steps>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<div v-show="stepNumber === 0">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="商品名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入商品名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="商品描述" prop="introduction">
|
||||
<el-input v-model="form.introduction" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="父类型" prop="parent">
|
||||
<el-input v-model="form.parent" placeholder="请输入父类型" />
|
||||
</el-form-item>
|
||||
<el-form-item label="商品图片" prop="image">
|
||||
<image-upload v-model="form.image"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品轮播图" prop="carouselImages">
|
||||
<image-upload v-model="form.carouselImages"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="商品状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio
|
||||
v-for="dict in dict.type.sys_yes_no"
|
||||
:key="dict.value"
|
||||
:label="parseInt(dict.value)"
|
||||
:label="dict.value"
|
||||
>{{dict.label}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="规格" prop="ruleId">
|
||||
<el-input v-model="form.ruleId" placeholder="请输入规格" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="品牌" prop="brandId">
|
||||
<el-input v-model="form.brandId" placeholder="请输入品牌" />
|
||||
<el-select
|
||||
v-model="form.brandId"
|
||||
filterable
|
||||
remote
|
||||
reserve-keyword
|
||||
placeholder="请输入关键词"
|
||||
:remote-method="remoteSearchBrandList"
|
||||
:loading="loading">
|
||||
<el-option
|
||||
v-for="brand in brandList"
|
||||
:key="brand.id"
|
||||
:label="brand.nam"
|
||||
:value="brand.id">
|
||||
<el-row>
|
||||
<image-preview :height="40" :width="40" :src="brand.logo" style="float: left;"/>
|
||||
<div style="float: left; margin: 2px 18px 0 15px; font-size: 20px;">{{brand.nam}}</div>
|
||||
</el-row>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人" prop="createdBy">
|
||||
<el-input v-model="form.createdBy" placeholder="请输入创建人" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-form-item label="商品图片" prop="image">
|
||||
<image-upload v-model="form.image"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createdTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.createdTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择创建时间">
|
||||
</el-date-picker>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-form-item label="商品轮播图" prop="carouselImages">
|
||||
<image-upload v-model="form.carouselImages"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人" prop="updatedBy">
|
||||
<el-input v-model="form.updatedBy" placeholder="请输入更新人" />
|
||||
</el-row>
|
||||
</div>
|
||||
<div v-show="stepNumber === 1">
|
||||
<el-form-item label="品类" prop="type">
|
||||
<el-cascader
|
||||
style="width: 100%"
|
||||
v-model="categoryOptionValue"
|
||||
clearable
|
||||
:props="{'value': 'id', 'label': 'name'}"
|
||||
:options="categoryOptions"></el-cascader>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间" prop="updatedTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.updatedTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择更新时间">
|
||||
</el-date-picker>
|
||||
<el-empty v-show="categoryOptionValue.length === 0" description="请选择品类,在进行操作"></el-empty>
|
||||
<el-tabs v-show="categoryOptionValue.length > 0" v-model="activeName" type="border-card">
|
||||
<el-tab-pane label="商品属性组" name="attributeGroup">
|
||||
<el-row style="overflow-x: auto; height: 300px;">
|
||||
<el-col :span="6" v-for="templateAttributeGroup in categoryCommonElement.templateAttributeGroupList">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>属性组【{{templateAttributeGroup.groupName}}】</span>
|
||||
</div>
|
||||
<div style="height: 200px; width: 100%;">
|
||||
<el-form ref="templateAttributeGroupForm" label-width="80px">
|
||||
<el-form-item :label="attribute.name" v-for="attribute in templateAttributeGroup.attributeList">
|
||||
<el-input v-model="attribute.value"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="商品属性" name="attribute">
|
||||
<el-row style="overflow-x: auto; height: 300px;">
|
||||
<el-form ref="form" :model="form" label-width="80px">
|
||||
<el-col :span="6" v-for="templateAttribute in categoryCommonElement.templateAttributeList">
|
||||
<el-form-item :label="templateAttribute.name" >
|
||||
<el-input v-model="templateAttribute.value"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="自有属性" name="third">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>添加商品属性</span>
|
||||
</div>
|
||||
<el-row>
|
||||
<el-button v-show="!customAttributeFormStatus" @click="customAttributeFormStatus = true">添加自有属性</el-button>
|
||||
<el-form v-show="customAttributeFormStatus" :inline="true" :model="customAttributeForm" class="demo-form-inline">
|
||||
<el-form-item label="属性编码">
|
||||
<el-input v-model="customAttributeForm.code" placeholder="属性编码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="属性名称">
|
||||
<el-input v-model="customAttributeForm.name" placeholder="属性名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="属性值">
|
||||
<el-input v-model="customAttributeForm.value" placeholder="属性值"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="saveCustomAttribute">确定</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>选择属性</span>
|
||||
</div>
|
||||
<el-row style="height: 80px; overflow-y: auto">
|
||||
<el-checkbox-group v-model="attributeIdCheckedList" @change="attributeCheckedFun">
|
||||
<el-col :span="4" v-for="attribute in categoryCommonElement.attributeList" style="margin: 5px 0">
|
||||
<el-checkbox :label="attribute.id" :value="attribute.id" :key="attribute.id" border>{{attribute.name}}</el-checkbox>
|
||||
</el-col>
|
||||
</el-checkbox-group>
|
||||
</el-row>
|
||||
</el-card>
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>属性值填写</span>
|
||||
</div>
|
||||
<el-row style="overflow-x: auto; height: 300px;">
|
||||
<el-form ref="attributeForm" :model="form" label-width="80px">
|
||||
<el-col :span="6" v-for="attribute in attributeCheckedList">
|
||||
<el-form-item :label="attribute.name">
|
||||
<el-input v-model="attribute.value"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
<div v-show="stepNumber === 2">
|
||||
<el-form-item label="规格" prop="ruleId">
|
||||
<el-select v-model="form.ruleId" placeholder="请选择" @change="changeRule" style="width: 100%;">
|
||||
<el-option
|
||||
v-for="rule in ruleList"
|
||||
:key="rule.id"
|
||||
:label="rule.name"
|
||||
:value="rule.id">
|
||||
<span>{{rule.name}} - {{rule.ruleAttrList.map(ruleAttr => ruleAttr.name).toString()}}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form :inline="true" :model="oneSettingForm" class="demo-form-inline">
|
||||
<el-form-item label="图片">
|
||||
<image-upload
|
||||
:limit="1"
|
||||
:is-show-tip="false"
|
||||
v-model="oneSettingForm.image" placeholder="审批人"></image-upload>
|
||||
</el-form-item>
|
||||
<el-form-item label="价格">
|
||||
<el-input v-model="oneSettingForm.price" placeholder="价格"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="库存">
|
||||
<el-input v-model="oneSettingForm.stock" placeholder="库存"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="oneSetting">一键设置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="skuList"
|
||||
border
|
||||
style="width: 100%">
|
||||
<el-table-column v-for="title in titleList" :prop="title.prop" :label="title.label">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="title.prop.indexOf('prop') > -1">{{scope.row[title.prop]}}</span>
|
||||
<el-input-number v-else-if="['stock','price'].indexOf(title.prop) > -1" v-model="scope.row[title.prop]" :precision="2" :step="0.01"></el-input-number>
|
||||
<image-upload v-else-if="['image'].indexOf(title.prop) > -1" v-model="scope.row[title.prop]"
|
||||
:limit="1"
|
||||
:is-show-tip="false"
|
||||
></image-upload>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div v-show="stepNumber === 3">
|
||||
<el-form-item label="商品描述" prop="introduction">
|
||||
<editor v-model="form.introduction" :min-height="192"/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button style="margin-top: 12px;" @click="last" v-if="stepNumber > 0">上一步</el-button>
|
||||
<el-button style="margin-top: 12px;" @click="next" v-if="stepNumber < 3">下一步</el-button>
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
|
@ -218,6 +366,10 @@
|
|||
|
||||
<script>
|
||||
import { listInfo, getInfo, delInfo, addInfo, updateInfo } from "@/api/product/info";
|
||||
import {listBrand} from "@/api/product/brand";
|
||||
import {getTemplateAttribute, listCategory} from "@/api/product/category";
|
||||
import {listRule} from "@/api/product/rule";
|
||||
import {addAttribute} from "@/api/product/attribute";
|
||||
|
||||
export default {
|
||||
name: "Info",
|
||||
|
@ -249,7 +401,7 @@ export default {
|
|||
name: null,
|
||||
introduction: null,
|
||||
mianType: null,
|
||||
parent: null,
|
||||
parentType: null,
|
||||
type: null,
|
||||
image: null,
|
||||
carouselImages: null,
|
||||
|
@ -261,19 +413,242 @@ export default {
|
|||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
createdBy: [
|
||||
{ required: true, message: "创建人不能为空", trigger: "blur" }
|
||||
name: [
|
||||
{ required: true, message: "商品名称不能为空", trigger: "blur" }
|
||||
],
|
||||
createdTime: [
|
||||
{ required: true, message: "创建时间不能为空", trigger: "blur" }
|
||||
status: [
|
||||
{ required: true, message: "商品状态不能为空", trigger: "blur" }
|
||||
],
|
||||
brandId: [
|
||||
{ required: true, message: "商品品牌不能为空", trigger: "blur" }
|
||||
],
|
||||
image: [
|
||||
{ required: true, message: "商品图片不能为空", trigger: "blur" }
|
||||
],
|
||||
carouselImages: [
|
||||
{ required: true, message: "商品轮播图不能为空", trigger: "blur" }
|
||||
],
|
||||
type: [
|
||||
{ required: true, message: "商品品类不能为空", trigger: "blur" }
|
||||
],
|
||||
ruleId: [
|
||||
{ required: true, message: "商品规格不能为空", trigger: "blur" }
|
||||
],
|
||||
},
|
||||
rulesTemplateMap: {
|
||||
0: ["name", "status", "brandId", "image", "carouselImages"],
|
||||
1: ["type"],
|
||||
2: ["ruleId"],
|
||||
},
|
||||
stepNumber: 0,
|
||||
brandList: [],
|
||||
categoryOptions: [],
|
||||
categoryOptionValue: [],
|
||||
ruleList: [],
|
||||
activeName: "attributeGroup",
|
||||
customAttributeForm: {
|
||||
|
||||
},
|
||||
customAttributeFormStatus: false,
|
||||
attributeIdCheckedList: [],
|
||||
attributeCheckedList: [],
|
||||
categoryCommonElement: {
|
||||
templateAttributeGroupList: [],
|
||||
templateAttributeList: [],
|
||||
attributeList: []
|
||||
},
|
||||
templateTitleList: [
|
||||
{
|
||||
"label":"规格图片",
|
||||
"prop":"image"
|
||||
},
|
||||
{
|
||||
"label":"商品库存",
|
||||
"prop":"stock"
|
||||
}, {
|
||||
"label":"商品价格",
|
||||
"prop":"price"
|
||||
}
|
||||
],
|
||||
titleList: [],
|
||||
skuList: [],
|
||||
oneSettingForm: {
|
||||
"image": null,
|
||||
"stock": null,
|
||||
"price": null
|
||||
}
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
categoryOptionValue: {
|
||||
handler(value){
|
||||
if (value !== null && value !== undefined && value.length > 0){
|
||||
this.form.mianType = value[0];
|
||||
this.form.parentType = value[1];
|
||||
this.form.type = value[2];
|
||||
}else {
|
||||
this.form.mianType = null;
|
||||
this.form.parentType = null;
|
||||
this.form.type = null;
|
||||
}
|
||||
}
|
||||
},
|
||||
"form.type": {
|
||||
handler(value) {
|
||||
console.log(value)
|
||||
if (value != null){
|
||||
getTemplateAttribute(value).then(response => {
|
||||
const {data} = response;
|
||||
const {templateAttributeGroupList,templateAttributeList,attributeList} = data;
|
||||
this.categoryCommonElement.templateAttributeGroupList = templateAttributeGroupList;
|
||||
this.categoryCommonElement.templateAttributeList = templateAttributeList;
|
||||
this.categoryCommonElement.attributeList = attributeList;
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
oneSetting(){
|
||||
this.skuList.forEach(skuInfo => {
|
||||
skuInfo.image = this.oneSettingForm.image;
|
||||
skuInfo.stock = this.oneSettingForm.stock;
|
||||
skuInfo.price = this.oneSettingForm.price;
|
||||
})
|
||||
},
|
||||
changeRule(ruleId){
|
||||
this.titleList = []
|
||||
let ruleInfo = this.ruleList.find(ruleInfo => ruleInfo.id === ruleId);
|
||||
const {ruleAttrList} = ruleInfo;
|
||||
let skuTotal = 1;
|
||||
for (let ruleAttrListKey in ruleAttrList) {
|
||||
let ruleAttrInfo = ruleAttrList[ruleAttrListKey];
|
||||
this.titleList.push({
|
||||
"label":ruleAttrInfo.name,
|
||||
"prop":"prop"+ruleAttrListKey
|
||||
})
|
||||
skuTotal = skuTotal * ruleAttrInfo.valueList.length;
|
||||
}
|
||||
this.titleList.push(...this.templateTitleList) ;
|
||||
console.log(this.titleList);
|
||||
this.skuList = [];
|
||||
for (let i = 0; i < skuTotal; i++) {
|
||||
this.skuList.push(
|
||||
{
|
||||
"image": null,
|
||||
"price": 85.62,
|
||||
"stock": 236
|
||||
}
|
||||
);
|
||||
}
|
||||
// currentIndex 当前下标
|
||||
for (let currentIndex in ruleAttrList) {
|
||||
let ruleAttrInfo = ruleAttrList[currentIndex];
|
||||
// 连续出现次数 循环出现次数
|
||||
let continuousSize = 1, forSize = 1;
|
||||
for (let continuousIndex = parseInt(currentIndex) + 1 ; continuousIndex < ruleAttrList.length ; continuousIndex++ ){
|
||||
continuousSize = continuousSize * ruleAttrList[continuousIndex].valueList.length;
|
||||
}
|
||||
for (let forIndex = parseInt(currentIndex) - 1; forIndex >= 0; forIndex--){
|
||||
forSize = forSize * ruleAttrList[forIndex].valueList.length
|
||||
}
|
||||
console.log(`${ruleAttrInfo.name} 规格 连续出现次数:${continuousSize} 循环出现次数:${forSize}`)
|
||||
let counter = 0;
|
||||
for (let forIndex = 0; forIndex < forSize; forIndex++) {
|
||||
const {valueList} = ruleAttrInfo;
|
||||
valueList.forEach(value => {
|
||||
for (let continuousIndex = 0; continuousIndex < continuousSize; continuousIndex++) {
|
||||
this.skuList[counter++]["prop"+currentIndex] = value;
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
saveCustomAttribute(){
|
||||
addAttribute({"code": this.customAttributeForm.code, "name": this.customAttributeForm.name}).then(response => {
|
||||
if (response.code === 200){
|
||||
// 添加逻辑
|
||||
let attributeId = response.data,
|
||||
code = this.customAttributeForm.code,
|
||||
name = this.customAttributeForm.name,
|
||||
value = this.customAttributeForm.value;
|
||||
// categoryCommonElement / attributeIdCheckedList / attributeCheckedList
|
||||
this.categoryCommonElement.attributeList.push({
|
||||
"id": attributeId,
|
||||
"name": name,
|
||||
"code": code
|
||||
});
|
||||
this.attributeIdCheckedList.push(attributeId);
|
||||
this.attributeCheckedList.push(
|
||||
{
|
||||
"id": attributeId,
|
||||
"name": name,
|
||||
"value": value
|
||||
}
|
||||
);
|
||||
this.customAttributeForm = {}
|
||||
this.customAttributeFormStatus = false;
|
||||
}
|
||||
})
|
||||
},
|
||||
attributeCheckedFun() {
|
||||
// attributeIdCheckedList -> attributeCheckedList 不在
|
||||
// 1 -> ID 1 : attributeCheckedList[] -> 1
|
||||
// 2 -> ID 3 : attributeCheckedList[1] -> 3
|
||||
let attributeId =this.attributeIdCheckedList
|
||||
.find(attributeId =>
|
||||
this.attributeCheckedList.map(attributeChecked => attributeChecked.id).indexOf(attributeId) === -1
|
||||
)
|
||||
if (attributeId !== undefined){
|
||||
let attributeInfo = this.categoryCommonElement.attributeList.find(attributeInfo => attributeInfo.id === attributeId);
|
||||
this.attributeCheckedList.push(attributeInfo);
|
||||
}else {
|
||||
// attributeIdCheckedList [3] : attributeCheckedList [] -> [3]
|
||||
// attributeIdCheckedList [3,5] : attributeCheckedList [3] -> [3,5]
|
||||
// attributeIdCheckedList [3,5,9] : attributeCheckedList [3,5] -> [3,5,9]
|
||||
// attributeIdCheckedList [3,9] : attributeCheckedList [3,5,9] -> [3,9]
|
||||
// attributeCheckedList 集合 不在 attributeIdCheckedList 集合的元素,然后删除
|
||||
let attributeChecked = this.attributeCheckedList.find(attributeChecked => this.attributeIdCheckedList.indexOf(attributeChecked.id) === -1);
|
||||
this.attributeCheckedList.splice(this.attributeCheckedList.indexOf(attributeChecked), 1);
|
||||
}
|
||||
|
||||
},
|
||||
initRuleList(){
|
||||
listRule({"params[isPage]": false}).then(response => {
|
||||
this.ruleList = response.data;
|
||||
});
|
||||
},
|
||||
initCategoryTree(){
|
||||
listCategory().then(response => {
|
||||
this.categoryOptions = [];
|
||||
this.categoryOptions = this.handleTree(response.data, "id", "parentId");
|
||||
console.log(this.categoryOptions)
|
||||
});
|
||||
},
|
||||
remoteSearchBrandList(queryValue){
|
||||
listBrand({"nam": queryValue, "params[isPage]": false}).then(response => {
|
||||
this.brandList = response.data;
|
||||
});
|
||||
},
|
||||
last() {
|
||||
this.stepNumber--
|
||||
},
|
||||
next() {
|
||||
let isValidate = true;
|
||||
this.$refs["form"].validateField(this.rulesTemplateMap[this.stepNumber],(valid) => {
|
||||
console.log(valid)
|
||||
if (valid) {
|
||||
isValidate = false;
|
||||
}
|
||||
});
|
||||
if (isValidate){
|
||||
this.stepNumber++
|
||||
}
|
||||
},
|
||||
/** 查询商品信息列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
|
@ -295,7 +670,7 @@ export default {
|
|||
name: null,
|
||||
introduction: null,
|
||||
mianType: null,
|
||||
parent: null,
|
||||
parentType: null,
|
||||
type: null,
|
||||
image: null,
|
||||
carouselImages: null,
|
||||
|
@ -303,12 +678,14 @@ export default {
|
|||
ruleId: null,
|
||||
brandId: null,
|
||||
remark: null,
|
||||
createdBy: null,
|
||||
createdTime: null,
|
||||
updatedBy: null,
|
||||
updatedTime: null
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
this.initCategoryTree();
|
||||
this.initRuleList();
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
|
@ -381,3 +758,11 @@ export default {
|
|||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.el-select-dropdown__item{
|
||||
height: 45px;
|
||||
}
|
||||
.box-card {
|
||||
margin: 10px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -65,6 +65,18 @@
|
|||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="主键" align="center" prop="id" />
|
||||
<el-table-column label="规格名称" align="center" prop="name" />
|
||||
<el-table-column label="规格属性名" align="center" prop="name" >
|
||||
<template slot-scope="scope">
|
||||
<el-row v-for="ruleAttr in scope.row.ruleAttrList"><span>{{ruleAttr.name}}</span></el-row>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="规格属性值" align="center" prop="name" >
|
||||
|
||||
<template slot-scope="scope">
|
||||
<el-row v-for="ruleAttr in scope.row.ruleAttrList"><span>{{ruleAttr.valueList.toString()}}</span></el-row>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="规格状态" align="center" prop="status" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
|
@ -96,7 +108,7 @@
|
|||
/>
|
||||
|
||||
<!-- 添加或修改商品规格对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-dialog :title="title" :visible.sync="open" width="80%" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="规格名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入规格名称" />
|
||||
|
@ -104,29 +116,46 @@
|
|||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人" prop="createdBy">
|
||||
<el-input v-model="form.createdBy" placeholder="请输入创建人" />
|
||||
<el-row v-for="(ruleAttr, index) in form.ruleAttrList">
|
||||
<el-row style="margin: 20px 0">
|
||||
<el-tag
|
||||
:key="ruleAttr.name"
|
||||
@close="removeRule(index)"
|
||||
closable>
|
||||
{{ruleAttr.name}}
|
||||
</el-tag>
|
||||
</el-row>
|
||||
<el-row style="margin: 10px 0">
|
||||
<el-tag
|
||||
style="float: left; margin-right: 20px"
|
||||
v-for="(ruleProperty, index) in ruleAttr.valueList"
|
||||
:key="ruleProperty"
|
||||
@close="removeRuleProperty(ruleAttr.valueList, index)"
|
||||
closable>
|
||||
{{ruleProperty}}
|
||||
</el-tag>
|
||||
<el-button v-if="!ruleAttr.ruleAttrAddStatus" @click="ruleAttr.ruleAttrAddStatus = !ruleAttr.ruleAttrAddStatus" size="mini">添加</el-button>
|
||||
<el-input v-if="ruleAttr.ruleAttrAddStatus"
|
||||
v-model="addRulePropertyValue"
|
||||
@blur="addRuleProperty(ruleAttr, false)"
|
||||
@keyup.enter.native="addRuleProperty(ruleAttr, true)"
|
||||
size="mini" placeholder="请输入规格属性值" style="float: left; width: 150px"/>
|
||||
</el-row>
|
||||
<el-divider></el-divider>
|
||||
</el-row>
|
||||
<el-button v-if="!ruleAddFormStatus" @click="ruleAddFormStatus = !ruleAddFormStatus">添加规格</el-button>
|
||||
<el-form v-if="ruleAddFormStatus" :inline="true" :model="ruleAddForm" class="demo-form-inline">
|
||||
<el-form-item label="规格名称">
|
||||
<el-input v-model="ruleAddForm.name" placeholder="请输入规格名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createdTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.createdTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择创建时间">
|
||||
</el-date-picker>
|
||||
<el-form-item label="规格属性">
|
||||
<el-input v-model="ruleAddForm.valueList" placeholder="请输入规格属性"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新人" prop="updatedBy">
|
||||
<el-input v-model="form.updatedBy" placeholder="请输入更新人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间" prop="updatedTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.updatedTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择更新时间">
|
||||
</el-date-picker>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="ruleAddFormFun">添加</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
|
@ -171,19 +200,90 @@ export default {
|
|||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
createdBy: [
|
||||
createBy: [
|
||||
{ required: true, message: "创建人不能为空", trigger: "blur" }
|
||||
],
|
||||
createdTime: [
|
||||
createTime: [
|
||||
{ required: true, message: "创建时间不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
},
|
||||
ruleAddForm: {
|
||||
name: null,
|
||||
valueList: null,
|
||||
},
|
||||
ruleAddFormStatus: false,
|
||||
addRulePropertyValue: null
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
removeRule(index){
|
||||
this.form.ruleAttrList.splice(index, 1);
|
||||
},
|
||||
removeRuleProperty(valueList,index){
|
||||
valueList.splice(index, 1);
|
||||
},
|
||||
addRuleProperty(ruleAttr, continuousInput){
|
||||
if (this.addRulePropertyValue === null || this.addRulePropertyValue === 0){
|
||||
if (!continuousInput){
|
||||
ruleAttr.ruleAttrAddStatus = !ruleAttr.ruleAttrAddStatus
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (ruleAttr.valueList.indexOf(this.addRulePropertyValue) > -1){
|
||||
this.$message({
|
||||
message: `规格[${ruleAttr.name}]属性值[${this.addRulePropertyValue}]已经存在`,
|
||||
type: 'warning'
|
||||
});
|
||||
return;
|
||||
}
|
||||
ruleAttr.valueList.push(this.addRulePropertyValue)
|
||||
this.addRulePropertyValue = null;
|
||||
if (!continuousInput){
|
||||
ruleAttr.ruleAttrAddStatus = !ruleAttr.ruleAttrAddStatus
|
||||
}
|
||||
},
|
||||
ruleAddFormFun(){
|
||||
if (this.ruleAddForm.name === null || this.ruleAddForm.name.length === 0){
|
||||
this.$message({
|
||||
message: '规格名称不可为空',
|
||||
type: 'warning'
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (this.ruleAddForm.valueList === null || this.ruleAddForm.valueList.length === 0){
|
||||
this.$message({
|
||||
message: '规格属性不可为空',
|
||||
type: 'warning'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
let ruleAttr = this.form.ruleAttrList.find(ruleAttr => ruleAttr.name === this.ruleAddForm.name);
|
||||
if (ruleAttr === undefined){
|
||||
this.form.ruleAttrList.push({
|
||||
"name": this.ruleAddForm.name,
|
||||
"valueList": [this.ruleAddForm.valueList],
|
||||
"ruleAttrAddStatus": false
|
||||
})
|
||||
}else {
|
||||
if (ruleAttr.valueList.indexOf(this.ruleAddForm.valueList) > -1){
|
||||
this.$message({
|
||||
message: `规格[${this.ruleAddForm.name}]属性值[${this.ruleAddForm.valueList}]已经存在`,
|
||||
type: 'warning'
|
||||
});
|
||||
return;
|
||||
}
|
||||
ruleAttr.valueList.push(this.ruleAddForm.valueList)
|
||||
}
|
||||
this.ruleAddForm = {
|
||||
name: null,
|
||||
valueList: null,
|
||||
}
|
||||
this.ruleAddFormStatus = false;
|
||||
},
|
||||
/** 查询商品规格列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
|
@ -205,10 +305,7 @@ export default {
|
|||
name: null,
|
||||
status: null,
|
||||
remark: null,
|
||||
createdBy: null,
|
||||
createdTime: null,
|
||||
updatedBy: null,
|
||||
updatedTime: null
|
||||
ruleAttrList:[]
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
|
|
|
@ -155,7 +155,7 @@
|
|||
/>
|
||||
|
||||
<!-- 添加或修改参数配置对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" append-to-body width="500px">
|
||||
<el-dialog :title="title" :visible.sync="open" append-to-body width="80%">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="参数名称" prop="configName">
|
||||
<el-input v-model="form.configName" placeholder="请输入参数名称"/>
|
||||
|
|
|
@ -153,7 +153,7 @@
|
|||
/>
|
||||
|
||||
<!-- 添加或修改参数配置对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" append-to-body width="500px">
|
||||
<el-dialog :title="title" :visible.sync="open" append-to-body width="80%">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="字典类型">
|
||||
<el-input v-model="form.dictType" :disabled="true"/>
|
||||
|
|
|
@ -165,7 +165,7 @@
|
|||
/>
|
||||
|
||||
<!-- 添加或修改参数配置对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" append-to-body width="500px">
|
||||
<el-dialog :title="title" :visible.sync="open" append-to-body width="80%">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="字典名称" prop="dictName">
|
||||
<el-input v-model="form.dictName" placeholder="请输入字典名称"/>
|
||||
|
|
|
@ -130,7 +130,7 @@
|
|||
/>
|
||||
|
||||
<!-- 添加或修改岗位对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" append-to-body width="500px">
|
||||
<el-dialog :title="title" :visible.sync="open" append-to-body width="80%">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="岗位名称" prop="postName">
|
||||
<el-input v-model="form.postName" placeholder="请输入岗位名称"/>
|
||||
|
|
|
@ -165,7 +165,7 @@
|
|||
/>
|
||||
|
||||
<!-- 添加或修改角色配置对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" append-to-body width="500px">
|
||||
<el-dialog :title="title" :visible.sync="open" append-to-body width="80%">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="角色名称" prop="roleName">
|
||||
<el-input v-model="form.roleName" placeholder="请输入角色名称"/>
|
||||
|
@ -220,7 +220,7 @@
|
|||
</el-dialog>
|
||||
|
||||
<!-- 分配角色数据权限对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="openDataScope" append-to-body width="500px">
|
||||
<el-dialog :title="title" :visible.sync="openDataScope" append-to-body width="80%">
|
||||
<el-form :model="form" label-width="80px">
|
||||
<el-form-item label="角色名称">
|
||||
<el-input v-model="form.roleName" :disabled="true"/>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
:close-on-click-modal="false"
|
||||
:modal-append-to-body="false"
|
||||
v-bind="$attrs"
|
||||
width="500px"
|
||||
width="80%"
|
||||
@close="onClose"
|
||||
@open="onOpen"
|
||||
v-on="$listeners"
|
||||
|
|
|
@ -2,11 +2,6 @@
|
|||
<!-- 导入表 -->
|
||||
<el-dialog :visible.sync="visible" append-to-body title="导入表" top="5vh" width="800px">
|
||||
<el-form ref="queryForm" :inline="true" :model="queryParams" size="small">
|
||||
<el-form-item label="数据库名称">
|
||||
<el-select v-model="queryParams.databaseName" placeholder="请选择数据库名称">
|
||||
<el-option v-for="databaseName in databaseNameList" :label="databaseName" :value="databaseName"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="表名称" prop="tableName">
|
||||
<el-input
|
||||
v-model="queryParams.tableName"
|
||||
|
@ -53,25 +48,21 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import {importTable, listDbTable, getDataBaseList} from "@/api/tool/gen";
|
||||
import {importTable, listDbTable} from "@/api/tool/gen";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
visible: false,
|
||||
//数据库名称
|
||||
databaseName:'',
|
||||
// 选中数组值
|
||||
tables: [],
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 表数据
|
||||
dbTableList: [],
|
||||
databaseNameList:[],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
databaseName:undefined,
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
tableName: undefined,
|
||||
|
@ -82,7 +73,6 @@ export default {
|
|||
methods: {
|
||||
// 显示弹框
|
||||
show() {
|
||||
this.getDataBaseList();
|
||||
this.getList();
|
||||
this.visible = true;
|
||||
},
|
||||
|
@ -100,15 +90,6 @@ export default {
|
|||
this.total = res.data.total;
|
||||
});
|
||||
},
|
||||
// 查询表数据
|
||||
getDataBaseList() {
|
||||
debugger
|
||||
getDataBaseList().then(res => {
|
||||
if (res.code === 200){
|
||||
this.databaseNameList = res.data;
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
|
@ -121,14 +102,12 @@ export default {
|
|||
},
|
||||
/** 导入按钮操作 */
|
||||
handleImportTable() {
|
||||
this.databaseName=this.queryParams.databaseName
|
||||
const tableNames = this.tables.join(",");
|
||||
if (tableNames == "") {
|
||||
this.$modal.msgError("请选择要导入的表");
|
||||
return;
|
||||
}
|
||||
const importTableReq ={tables: tableNames, databaseName:this.databaseName }
|
||||
importTable(importTableReq).then(res => {
|
||||
importTable({tables: tableNames}).then(res => {
|
||||
this.$modal.msgSuccess("导入成功");
|
||||
this.visible = false;
|
||||
this.$emit("ok");
|
||||
|
|
|
@ -1,14 +1,6 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="68px" size="small">
|
||||
<el-form-item label="数据库名称" prop="databaseName">
|
||||
<el-input
|
||||
v-model="queryParams.databaseName"
|
||||
clearable
|
||||
placeholder="请输入数据库名称"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="表名称" prop="tableName">
|
||||
<el-input
|
||||
v-model="queryParams.tableName"
|
||||
|
@ -99,33 +91,23 @@
|
|||
<span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:show-overflow-tooltip="true"
|
||||
align="center"
|
||||
label="数据库名称"
|
||||
prop="databaseName"
|
||||
width="120"
|
||||
/>
|
||||
<el-table-column
|
||||
:show-overflow-tooltip="true"
|
||||
align="center"
|
||||
label="表名称"
|
||||
prop="tableName"
|
||||
width="120"
|
||||
/>
|
||||
<el-table-column
|
||||
:show-overflow-tooltip="true"
|
||||
align="center"
|
||||
label="表描述"
|
||||
prop="tableComment"
|
||||
width="120"
|
||||
/>
|
||||
<el-table-column
|
||||
:show-overflow-tooltip="true"
|
||||
align="center"
|
||||
label="实体"
|
||||
prop="className"
|
||||
width="120"
|
||||
/>
|
||||
<el-table-column align="center" label="创建时间" prop="createTime" width="160"/>
|
||||
<el-table-column align="center" label="更新时间" prop="updateTime" width="160"/>
|
||||
|
@ -244,7 +226,6 @@ export default {
|
|||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
databaseName: '',
|
||||
tableName: undefined,
|
||||
tableComment: undefined
|
||||
},
|
||||
|
@ -302,9 +283,8 @@ export default {
|
|||
/** 同步数据库操作 */
|
||||
handleSynchDb(row) {
|
||||
const tableName = row.tableName;
|
||||
const databaseName = row.databaseName;
|
||||
this.$modal.confirm('确认要强制同步"'+databaseName + tableName + '"表结构吗?').then(function () {
|
||||
return synchDb(tableName,databaseName);
|
||||
this.$modal.confirm('确认要强制同步"' + tableName + '"表结构吗?').then(function () {
|
||||
return synchDb(tableName);
|
||||
}).then(() => {
|
||||
this.$modal.msgSuccess("同步成功");
|
||||
}).catch(() => {
|
||||
|
|
Loading…
Reference in New Issue