From 4eac422e52a4d28fb651b75d0f054697c7a2c0fa Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期一, 09 二月 2026 15:14:13 +0800
Subject: [PATCH] 优化
---
admin/src/views/business/labelsBrand.vue | 120 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 120 insertions(+), 0 deletions(-)
diff --git a/admin/src/views/business/labelsBrand.vue b/admin/src/views/business/labelsBrand.vue
new file mode 100644
index 0000000..60359d9
--- /dev/null
+++ b/admin/src/views/business/labelsBrand.vue
@@ -0,0 +1,120 @@
+<template>
+ <TableLayout :permissions="['business:labels:query']">
+ <!-- 鎼滅储琛ㄥ崟 -->
+ <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline>
+ <el-form-item label="閫傜敤鍝佺墝鍚嶇О" prop="name">
+ <el-input v-model="searchForm.name" placeholder="璇疯緭鍏ラ�傜敤鍝佺墝鍚嶇О" @keypress.enter.native="search"></el-input>
+ </el-form-item>
+ <section>
+ <el-button type="primary" @click="search">鎼滅储</el-button>
+ <el-button @click="reset">閲嶇疆</el-button>
+ </section>
+ </el-form>
+ <!-- 琛ㄦ牸鍜屽垎椤� -->
+ <template v-slot:table-wrap>
+ <ul class="toolbar" v-permissions="['business:labels:create', 'business:labels:delete']">
+ <li><el-button type="primary" @click="$refs.operaLabelsWindow.open('鏂板缓閫傜敤鍝佺墝淇℃伅琛�',null,searchForm.type)" icon="el-icon-plus" v-permissions="['business:labels:create']">鏂板缓</el-button></li>
+ <li><el-button type="danger" @click="deleteByIdInBatch" icon="el-icon-delete" v-permissions="['business:labels:delete']">鍒犻櫎</el-button></li>
+ </ul>
+ <el-table
+ v-loading="isWorking.search"
+ :data="tableData.list"
+ border
+ stripe
+ @selection-change="handleSelectionChange"
+ >
+ <el-table-column type="selection" width="55"></el-table-column>
+ <el-table-column prop="name" label="閫傜敤鍝佺墝鍚嶇О" min-width="100px"></el-table-column>
+ <el-table-column prop="imgurlfull" label="灞曠ず鍥�" align="center" min-width="100px">
+ <template slot-scope="{row}">
+ <el-image style="max-width: 100px;max-height: 50px;" v-if="row.imgFullurl" :src="row.imgFullurl" :preview-src-list="[row.imgFullurl]"></el-image>
+ </template>
+ </el-table-column>
+ <el-table-column prop="sortnum" label="鎺掑簭鐮�" min-width="100px"></el-table-column>
+ <el-table-column prop="editDate" label="鏈�杩戞椂闂�" min-width="100px"></el-table-column>
+ <el-table-column prop="status" label="鐘舵��" min-width="100px">
+ <template slot-scope="{row}">
+ <el-switch
+ v-model="row.status"
+ :active-value="1"
+ :inactive-value="0"
+ active-color="#13ce66"
+ inactive-color="#ff4949"
+ @change="statusChange(row)"
+ ></el-switch>
+ </template>
+ </el-table-column>
+ <el-table-column
+ v-if="containPermissions(['business:labels:update', 'business:labels:delete'])"
+ label="鎿嶄綔"
+ min-width="120"
+ fixed="right"
+ >
+ <template slot-scope="{row}">
+ <el-button type="text" @click="$refs.operaLabelsWindow.open('缂栬緫閫傜敤鍝佺墝淇℃伅琛�', row,searchForm.type)" icon="el-icon-edit" v-permissions="['business:labels:update']">缂栬緫</el-button>
+ <el-button style="color: red" type="text" @click="deleteById(row)" icon="el-icon-delete" v-permissions="['business:labels:delete']">鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ <pagination
+ @size-change="handleSizeChange"
+ @current-change="handlePageChange"
+ :pagination="tableData.pagination"
+ >
+ </pagination>
+ </template>
+ <!-- 鏂板缓/淇敼 -->
+ <OperaLabelsWindow ref="operaLabelsWindow" @success="handlePageChange"/>
+ </TableLayout>
+</template>
+
+<script>
+import BaseTable from '@/components/base/BaseTable'
+import TableLayout from '@/layouts/TableLayout'
+import Pagination from '@/components/common/Pagination'
+import OperaLabelsWindow from '@/components/business/OperaLabelsZhuanquWindow'
+import {updateStatusById} from "@/api/business/labels";
+export default {
+ name: 'Labels',
+ extends: BaseTable,
+ components: { TableLayout, Pagination, OperaLabelsWindow },
+ data () {
+ return {
+ // 鎼滅储
+ searchForm: {
+ name: '',
+ type: 14
+ },
+ labels: []
+ }
+ },
+ provide () {
+ return {
+ labels: () => this.labels
+ }
+ },
+ created () {
+ this.config({
+ module: '閫傜敤鍝佺墝淇℃伅琛�',
+ api: '/business/labels',
+ 'field.id': 'id',
+ 'field.main': 'id'
+ })
+ this.search()
+ },
+ methods: {
+ statusChange (row) {
+ this.api.updateStatusById({ id: row.id, status: row.status })
+ .then(() => {
+ this.$message.success('鎿嶄綔鎴愬姛')
+ })
+ .catch(e => {
+ this.$message.error('鎿嶄綔鎴愬姛')
+ })
+ .then(() => {
+ this.handlePageChange()
+ })
+ }
+ }
+}
+</script>
--
Gitblit v1.9.3