去除订单页面不用的代码
This commit is contained in:
parent
9dc8e6b866
commit
aadc208c73
|
|
@ -1,133 +0,0 @@
|
||||||
import type { IContentConfig } from "@/components/CURD/types";
|
|
||||||
|
|
||||||
const contentConfig: IContentConfig = {
|
|
||||||
pageName: "sys:user",
|
|
||||||
table: {
|
|
||||||
showOverflowTooltip: true,
|
|
||||||
},
|
|
||||||
toolbar: [],
|
|
||||||
indexAction: function (params) {
|
|
||||||
// 模拟发起网络请求获取列表数据
|
|
||||||
console.log("indexAction:", params);
|
|
||||||
return Promise.resolve({
|
|
||||||
total: 2,
|
|
||||||
list: [
|
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
username: "tom",
|
|
||||||
avatar: "https://foruda.gitee.com/images/1723603502796844527/03cdca2a_716974.gif",
|
|
||||||
percent: 99,
|
|
||||||
price: 10,
|
|
||||||
url: "https://www.baidu.com",
|
|
||||||
icon: "el-icon-setting",
|
|
||||||
gender: 1,
|
|
||||||
status: 1,
|
|
||||||
status2: 1,
|
|
||||||
sort: 99,
|
|
||||||
createTime: 1715647982437,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
username: "jerry",
|
|
||||||
avatar: "https://foruda.gitee.com/images/1723603502796844527/03cdca2a_716974.gif",
|
|
||||||
percent: 88,
|
|
||||||
price: 999,
|
|
||||||
url: "https://www.google.com",
|
|
||||||
icon: "el-icon-user",
|
|
||||||
gender: 0,
|
|
||||||
status: 0,
|
|
||||||
status2: 0,
|
|
||||||
sort: 0,
|
|
||||||
createTime: 1715648977426,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
});
|
|
||||||
},
|
|
||||||
modifyAction(data) {
|
|
||||||
// 模拟发起网络请求修改字段
|
|
||||||
// console.log("modifyAction:", data);
|
|
||||||
ElMessage.success(JSON.stringify(data));
|
|
||||||
return Promise.resolve(null);
|
|
||||||
},
|
|
||||||
cols: [
|
|
||||||
{ type: "index", width: 50, align: "center" },
|
|
||||||
{ label: "ID", align: "center", prop: "id", show: false },
|
|
||||||
{ label: "文本", align: "center", prop: "username" },
|
|
||||||
{ label: "图片", align: "center", prop: "avatar", templet: "image" },
|
|
||||||
{
|
|
||||||
label: "百分比",
|
|
||||||
align: "center",
|
|
||||||
prop: "percent",
|
|
||||||
templet: "percent",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "货币符",
|
|
||||||
align: "center",
|
|
||||||
prop: "price",
|
|
||||||
templet: "price",
|
|
||||||
priceFormat: "$",
|
|
||||||
},
|
|
||||||
{ label: "链接", align: "center", prop: "url", width: 180, templet: "url" },
|
|
||||||
{ label: "图标", align: "center", prop: "icon", templet: "icon" },
|
|
||||||
{
|
|
||||||
label: "列表值",
|
|
||||||
align: "center",
|
|
||||||
prop: "gender",
|
|
||||||
templet: "list",
|
|
||||||
selectList: { "0": "女", "1": "男" },
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "自定义",
|
|
||||||
align: "center",
|
|
||||||
prop: "status",
|
|
||||||
templet: "custom",
|
|
||||||
slotName: "status",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "Switch",
|
|
||||||
align: "center",
|
|
||||||
prop: "status2",
|
|
||||||
templet: "switch",
|
|
||||||
activeValue: 1,
|
|
||||||
inactiveValue: 0,
|
|
||||||
activeText: "启用",
|
|
||||||
inactiveText: "禁用",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "输入框",
|
|
||||||
align: "center",
|
|
||||||
prop: "sort",
|
|
||||||
templet: "input",
|
|
||||||
inputType: "number",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "日期格式化",
|
|
||||||
align: "center",
|
|
||||||
prop: "createTime",
|
|
||||||
minWidth: 120,
|
|
||||||
templet: "date",
|
|
||||||
dateFormat: "YYYY/MM/DD HH:mm:ss",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "操作栏",
|
|
||||||
align: "center",
|
|
||||||
fixed: "right",
|
|
||||||
width: 220,
|
|
||||||
templet: "tool",
|
|
||||||
operat: [
|
|
||||||
{
|
|
||||||
name: "reset_pwd",
|
|
||||||
auth: "password:reset",
|
|
||||||
icon: "refresh-left",
|
|
||||||
text: "重置密码",
|
|
||||||
type: "primary",
|
|
||||||
render(row) {
|
|
||||||
return row.id === 1;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
|
|
||||||
export default contentConfig;
|
|
||||||
|
|
@ -1,84 +1,65 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<template v-if="isA">
|
<!-- 搜索 -->
|
||||||
<!-- 搜索 -->
|
<page-search
|
||||||
<page-search
|
ref="searchRef"
|
||||||
ref="searchRef"
|
:search-config="searchConfig"
|
||||||
:search-config="searchConfig"
|
@query-click="handleQueryClick"
|
||||||
@query-click="handleQueryClick"
|
@reset-click="handleResetClick"
|
||||||
@reset-click="handleResetClick"
|
/>
|
||||||
/>
|
<!-- 列表 -->
|
||||||
<!-- 列表 -->
|
<page-content
|
||||||
<page-content
|
ref="contentRef"
|
||||||
ref="contentRef"
|
:content-config="contentConfig"
|
||||||
:content-config="contentConfig"
|
@add-click="handleAddClick"
|
||||||
@add-click="handleAddClick"
|
@edit-click="handleEditClick"
|
||||||
@edit-click="handleEditClick"
|
@export-click="handleExportClick"
|
||||||
@export-click="handleExportClick"
|
@search-click="handleSearchClick"
|
||||||
@search-click="handleSearchClick"
|
@toolbar-click="handleToolbarClick"
|
||||||
@toolbar-click="handleToolbarClick"
|
@operat-click="handleOperatClick"
|
||||||
@operat-click="handleOperatClick"
|
@filter-change="handleFilterChange"
|
||||||
@filter-change="handleFilterChange"
|
>
|
||||||
>
|
<template #status="scope">
|
||||||
<template #status="scope">
|
<el-tag :type="scope.row[scope.prop] == 1 ? 'success' : 'info'">
|
||||||
<el-tag :type="scope.row[scope.prop] == 1 ? 'success' : 'info'">
|
{{ scope.row[scope.prop] == 1 ? "启用" : "禁用" }}
|
||||||
{{ scope.row[scope.prop] == 1 ? "启用" : "禁用" }}
|
</el-tag>
|
||||||
</el-tag>
|
</template>
|
||||||
</template>
|
<template #options="scope">
|
||||||
<template #options="scope">
|
{{ returnOptionsLabel(scope.prop, scope.row[scope.prop]) }}
|
||||||
{{ returnOptionsLabel(scope.prop, scope.row[scope.prop]) }}
|
</template>
|
||||||
</template>
|
<template #gender="scope">
|
||||||
<template #gender="scope">
|
<DictLabel v-model="scope.row[scope.prop]" code="gender" />
|
||||||
<DictLabel v-model="scope.row[scope.prop]" code="gender" />
|
</template>
|
||||||
</template>
|
<template #mobile="scope">
|
||||||
<template #mobile="scope">
|
<el-text>{{ scope.row[scope.prop] }}</el-text>
|
||||||
<el-text>{{ scope.row[scope.prop] }}</el-text>
|
<copy-button
|
||||||
<copy-button
|
v-if="scope.row[scope.prop]"
|
||||||
v-if="scope.row[scope.prop]"
|
:text="scope.row[scope.prop]"
|
||||||
:text="scope.row[scope.prop]"
|
style="margin-left: 2px"
|
||||||
style="margin-left: 2px"
|
/>
|
||||||
/>
|
</template>
|
||||||
</template>
|
</page-content>
|
||||||
</page-content>
|
|
||||||
|
|
||||||
<!-- 新增 -->
|
<!-- 新增 -->
|
||||||
<page-modal
|
<page-modal ref="addModalRef" :modal-config="addModalConfig" @submit-click="handleSubmitClick">
|
||||||
ref="addModalRef"
|
<template #url="scope">
|
||||||
:modal-config="addModalConfig"
|
<FileUpload v-model="scope.formData[scope.prop]" :limit="1" v-bind="scope.attrs" />
|
||||||
@submit-click="handleSubmitClick"
|
<!-- <Dict v-model="scope.formData[scope.prop]" code="gender" v-bind="scope.attrs" /> -->
|
||||||
>
|
</template>
|
||||||
<template #url="scope">
|
</page-modal>
|
||||||
<FileUpload v-model="scope.formData[scope.prop]" :limit="1" v-bind="scope.attrs" />
|
|
||||||
<!-- <Dict v-model="scope.formData[scope.prop]" code="gender" v-bind="scope.attrs" /> -->
|
|
||||||
</template>
|
|
||||||
</page-modal>
|
|
||||||
|
|
||||||
<!-- 编辑 -->
|
<!-- 编辑 -->
|
||||||
<page-modal
|
<page-modal
|
||||||
ref="editModalRef"
|
ref="editModalRef"
|
||||||
:modal-config="editModalConfig"
|
:modal-config="editModalConfig"
|
||||||
@submit-click="handleSubmitClick"
|
@submit-click="handleSubmitClick"
|
||||||
>
|
>
|
||||||
<template #url="scope">
|
<template #url="scope">
|
||||||
<FileUpload v-model="scope.formData[scope.prop]" :limit="1" v-bind="scope.attrs" />
|
<FileUpload v-model="scope.formData[scope.prop]" :limit="1" v-bind="scope.attrs" />
|
||||||
<!-- <Dict v-model="scope.formData[scope.prop]" code="gender" v-bind="scope.attrs" /> -->
|
<!-- <Dict v-model="scope.formData[scope.prop]" code="gender" v-bind="scope.attrs" /> -->
|
||||||
</template>
|
</template>
|
||||||
</page-modal>
|
</page-modal>
|
||||||
</template>
|
|
||||||
<template v-else>
|
|
||||||
<page-content
|
|
||||||
ref="contentRef"
|
|
||||||
:content-config="contentConfig2"
|
|
||||||
@operat-click="handleOperatClick"
|
|
||||||
>
|
|
||||||
<template #status="scope">
|
|
||||||
<el-tag :type="scope.row[scope.prop] == 1 ? 'success' : 'info'">
|
|
||||||
{{ scope.row[scope.prop] == 1 ? "启用" : "禁用" }}
|
|
||||||
</el-tag>
|
|
||||||
</template>
|
|
||||||
</page-content>
|
|
||||||
</template>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -90,7 +71,6 @@ import type { IObject, IOperatData } from "@/components/CURD/types";
|
||||||
import usePage from "@/components/CURD/usePage";
|
import usePage from "@/components/CURD/usePage";
|
||||||
import addModalConfig from "./config/add";
|
import addModalConfig from "./config/add";
|
||||||
import contentConfig from "./config/content";
|
import contentConfig from "./config/content";
|
||||||
import contentConfig2 from "./config/content2";
|
|
||||||
import editModalConfig from "./config/edit";
|
import editModalConfig from "./config/edit";
|
||||||
import searchConfig from "./config/search";
|
import searchConfig from "./config/search";
|
||||||
import { returnOptionsLabel } from "./config/config";
|
import { returnOptionsLabel } from "./config/config";
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue