update
This commit is contained in:
@@ -1,14 +1,33 @@
|
||||
<script setup>
|
||||
import {ref} from 'vue';
|
||||
import {reactive, ref, watch} from 'vue';
|
||||
import UploadOne from "../../../../../components/upload/UploadOne.vue";
|
||||
import Api from "../../../../../api/index.js";
|
||||
import {Message} from "@arco-design/web-vue";
|
||||
|
||||
const {title} = defineProps({
|
||||
title: {
|
||||
type: String,
|
||||
default: '二维码'
|
||||
const emits = defineEmits(['success']);
|
||||
const {detail} = defineProps({
|
||||
detail: {
|
||||
type: Object,
|
||||
default: {}
|
||||
}
|
||||
});
|
||||
|
||||
const visible = ref(false);
|
||||
const form = reactive({
|
||||
qrcode: null,
|
||||
position_text: null,
|
||||
});
|
||||
watch(
|
||||
() => visible.value,
|
||||
(val) => {
|
||||
if (val) Object.assign(form, detail)
|
||||
}
|
||||
)
|
||||
const edit = async () => {
|
||||
const {msg} = await Api.admin.editQRList(form);
|
||||
Message.success(msg);
|
||||
emits('success');
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -16,15 +35,16 @@ const visible = ref(false);
|
||||
|
||||
<a-modal
|
||||
ok-text="提交"
|
||||
:title="title"
|
||||
@ok="edit"
|
||||
title="二维码"
|
||||
title-align="start"
|
||||
v-model:visible="visible">
|
||||
<a-form>
|
||||
<a-form-item label="位置">
|
||||
<a-input placeholder="首页/添加客服&我的/联系客服"></a-input>
|
||||
<a-input v-model:model-value="form.position_text" disabled></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="二维码">
|
||||
<a-upload></a-upload>
|
||||
<upload-one size="100px" v-model:file="form.qrcode"></upload-one>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
|
||||
@@ -12,7 +12,7 @@ const columns = [
|
||||
},
|
||||
{
|
||||
title: '位置',
|
||||
dataIndex: 'key',
|
||||
dataIndex: 'position_text',
|
||||
},
|
||||
{
|
||||
title: '二维码',
|
||||
@@ -34,9 +34,9 @@ const vo = reactive({
|
||||
total: 0,
|
||||
});
|
||||
|
||||
const {loading, pagination, initFetchData} = useTableQuery({
|
||||
const {loading, pagination, fetchData} = useTableQuery({
|
||||
parameter: po,
|
||||
api: Api.system.getData,
|
||||
api: Api.admin.getQRList,
|
||||
callback: (data) => {
|
||||
Object.assign(vo, data);
|
||||
}
|
||||
@@ -52,15 +52,15 @@ const {loading, pagination, initFetchData} = useTableQuery({
|
||||
:data="vo.rows"
|
||||
:columns="columns"
|
||||
class="flex-grow mt-[20px] w-full">
|
||||
<template v-slot:qrcode>
|
||||
<template v-slot:qrcode="{record}">
|
||||
<a-image
|
||||
width="48px"
|
||||
height="48px"
|
||||
src="https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/a8c8cdb109cb051163646151a4a5083b.png~tplv-uwbnlip3yd-webp.webp">
|
||||
:src="record.qrcode">
|
||||
</a-image>
|
||||
</template>
|
||||
<template v-slot:action>
|
||||
<EditQR></EditQR>
|
||||
<template v-slot:action="{record}">
|
||||
<EditQR :detail="record" @success="fetchData"></EditQR>
|
||||
</template>
|
||||
</a-table>
|
||||
</template>
|
||||
|
||||
@@ -57,9 +57,9 @@ const vo = reactive({
|
||||
total: 0,
|
||||
});
|
||||
|
||||
const {loading, pagination, initFetchData} = useTableQuery({
|
||||
const {loading, pagination, fetchData} = useTableQuery({
|
||||
parameter: po,
|
||||
api: Api.system.getData,
|
||||
api: Api.admin.getArticlevategoryList,
|
||||
callback: (data) => {
|
||||
Object.assign(vo, data);
|
||||
}
|
||||
@@ -67,7 +67,9 @@ const {loading, pagination, initFetchData} = useTableQuery({
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AddFrequentlyQuestions></AddFrequentlyQuestions>
|
||||
<AddFrequentlyQuestions
|
||||
@success="fetchData">
|
||||
</AddFrequentlyQuestions>
|
||||
|
||||
<a-table
|
||||
:loading="loading"
|
||||
|
||||
@@ -4,15 +4,16 @@ import {reactive} from "vue";
|
||||
import useTableQuery from "../../../../../../hooks/useTableQuery.js";
|
||||
import Api from "../../../../../../api/index.js";
|
||||
import AddSecondaryClassificationManagement from "./components/AddSecondaryClassificationManagement.vue";
|
||||
import {Message} from "@arco-design/web-vue";
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: 'ID',
|
||||
dataIndex: 'key',
|
||||
dataIndex: 'id',
|
||||
},
|
||||
{
|
||||
title: '二级分类名称',
|
||||
dataIndex: 'key',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
{
|
||||
title: '排序',
|
||||
@@ -28,7 +29,8 @@ const columns = [
|
||||
},
|
||||
];
|
||||
|
||||
const po = reactive({});
|
||||
const po1 = reactive({pid: 1});
|
||||
const po2 = reactive({pid: 2});
|
||||
const vo1 = reactive({
|
||||
page: '',
|
||||
rows: [],
|
||||
@@ -40,21 +42,28 @@ const vo2 = reactive({
|
||||
total: 0,
|
||||
});
|
||||
|
||||
const {loading: loading1, pagination: pagination1, initFetchData: initFetchData1} = useTableQuery({
|
||||
parameter: po,
|
||||
api: Api.system.getData,
|
||||
const {loading: loading1, pagination: pagination1, fetchData: fetchData1} = useTableQuery({
|
||||
parameter: po1,
|
||||
api: Api.admin.getArticleCategoryList,
|
||||
callback: (data) => {
|
||||
Object.assign(vo1, data);
|
||||
}
|
||||
});
|
||||
|
||||
const {loading: loading2, pagination: pagination2, initFetchData: initFetchData2} = useTableQuery({
|
||||
parameter: po,
|
||||
api: Api.system.getData,
|
||||
const {loading: loading2, pagination: pagination2, fetchData: fetchData2} = useTableQuery({
|
||||
parameter: po2,
|
||||
api: Api.admin.getArticleCategoryList,
|
||||
callback: (data) => {
|
||||
Object.assign(vo2, data);
|
||||
}
|
||||
});
|
||||
|
||||
const del = async (id) => {
|
||||
const {msg} = await Api.admin.delArticle(id);
|
||||
Message.success(msg);
|
||||
await fetchData1();
|
||||
await fetchData2();
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -63,7 +72,11 @@ const {loading: loading2, pagination: pagination2, initFetchData: initFetchData2
|
||||
<div class="flex justify-between">
|
||||
<div class="title">常见问题</div>
|
||||
|
||||
<AddSecondaryClassificationManagement :max-class="1"></AddSecondaryClassificationManagement>
|
||||
<AddSecondaryClassificationManagement
|
||||
@success="fetchData1"
|
||||
:pid="1"
|
||||
:max-class="1">
|
||||
</AddSecondaryClassificationManagement>
|
||||
</div>
|
||||
|
||||
<a-table
|
||||
@@ -73,15 +86,25 @@ const {loading: loading2, pagination: pagination2, initFetchData: initFetchData2
|
||||
:loading="loading1"
|
||||
:columns="columns"
|
||||
class="w-full h-full">
|
||||
<template v-slot:sort>
|
||||
<SequenceAdjustment></SequenceAdjustment>
|
||||
<template v-slot:sort="{record}">
|
||||
<SequenceAdjustment
|
||||
:id="record.id"
|
||||
@success="fetchData1"
|
||||
:api="Api.admin.weighArticleCategory">
|
||||
</SequenceAdjustment>
|
||||
</template>
|
||||
<template v-slot:action>
|
||||
<template v-slot:action="{record}">
|
||||
<div class="flex gap-[10px]">
|
||||
<AddSecondaryClassificationManagement :max-class="1">
|
||||
<AddSecondaryClassificationManagement
|
||||
@success="fetchData1"
|
||||
:detail="record"
|
||||
:pid="1"
|
||||
:max-class="1">
|
||||
<a-link :hoverable="false">编辑</a-link>
|
||||
</AddSecondaryClassificationManagement>
|
||||
<a-link :hoverable="false" status="danger">删除</a-link>
|
||||
<a-popconfirm content="确定删除吗?" @ok="del(record.id)">
|
||||
<a-link :hoverable="false" status="danger">删除</a-link>
|
||||
</a-popconfirm>
|
||||
</div>
|
||||
</template>
|
||||
</a-table>
|
||||
@@ -91,7 +114,11 @@ const {loading: loading2, pagination: pagination2, initFetchData: initFetchData2
|
||||
<div class="flex justify-between">
|
||||
<div class="title">基础教学</div>
|
||||
|
||||
<AddSecondaryClassificationManagement :max-class="2"></AddSecondaryClassificationManagement>
|
||||
<AddSecondaryClassificationManagement
|
||||
@success="fetchData2"
|
||||
:pid="2"
|
||||
:max-class="2">
|
||||
</AddSecondaryClassificationManagement>
|
||||
</div>
|
||||
|
||||
<a-table
|
||||
@@ -101,15 +128,25 @@ const {loading: loading2, pagination: pagination2, initFetchData: initFetchData2
|
||||
:loading="loading2"
|
||||
:columns="columns"
|
||||
class="w-full h-full">
|
||||
<template v-slot:sort>
|
||||
<SequenceAdjustment></SequenceAdjustment>
|
||||
<template v-slot:sort="{record}">
|
||||
<SequenceAdjustment
|
||||
:id="record.id"
|
||||
@success="fetchData2"
|
||||
:api="Api.admin.weighArticleCategory">
|
||||
</SequenceAdjustment>
|
||||
</template>
|
||||
<template v-slot:action>
|
||||
<template v-slot:action="{record}">
|
||||
<div class="flex gap-[10px]">
|
||||
<AddSecondaryClassificationManagement :max-class="2">
|
||||
<AddSecondaryClassificationManagement
|
||||
@success="fetchData2"
|
||||
:detail="record"
|
||||
:pid="2"
|
||||
:max-class="2">
|
||||
<a-link :hoverable="false">编辑</a-link>
|
||||
</AddSecondaryClassificationManagement>
|
||||
<a-link :hoverable="false" status="danger">删除</a-link>
|
||||
<a-popconfirm content="确定删除吗?" @ok="del(record.id)">
|
||||
<a-link :hoverable="false" status="danger">删除</a-link>
|
||||
</a-popconfirm>
|
||||
</div>
|
||||
</template>
|
||||
</a-table>
|
||||
|
||||
@@ -1,20 +1,34 @@
|
||||
<script setup>
|
||||
import XSelect from "../../../../../../../components/XSelect/index.vue";
|
||||
import {reactive, ref} from "vue";
|
||||
import {reactive, ref, watch} from "vue";
|
||||
import Api from "../../../../../../../api/index.js";
|
||||
import {Message} from "@arco-design/web-vue";
|
||||
|
||||
const {maxClass} = defineProps({
|
||||
maxClass: {
|
||||
const emits = defineEmits(['success']);
|
||||
const {maxClass, pid, detail} = defineProps({
|
||||
pid: {
|
||||
type: Number,
|
||||
default: 1,
|
||||
},
|
||||
detail: {
|
||||
type: Object,
|
||||
default: {},
|
||||
}
|
||||
});
|
||||
|
||||
const visible = ref(false);
|
||||
|
||||
const form = reactive({
|
||||
title: null,
|
||||
name: null,
|
||||
});
|
||||
|
||||
watch(
|
||||
() => visible.value,
|
||||
(val) => {
|
||||
if (val) Object.assign(form, detail);
|
||||
}
|
||||
)
|
||||
|
||||
const getData = async () => {
|
||||
return new Promise((resolve) => {
|
||||
resolve({
|
||||
@@ -31,6 +45,23 @@ const getData = async () => {
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
const success = async () => {
|
||||
if (detail.id) {
|
||||
const {msg} = await Api.admin.editArticleCategory({
|
||||
pid,
|
||||
...form,
|
||||
});
|
||||
Message.success(msg);
|
||||
} else {
|
||||
const {msg} = await Api.admin.addArticleCategory({
|
||||
pid,
|
||||
...form,
|
||||
});
|
||||
Message.success(msg);
|
||||
}
|
||||
emits('success');
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -46,6 +77,7 @@ const getData = async () => {
|
||||
|
||||
|
||||
<a-modal
|
||||
@ok="success"
|
||||
title="新增二级分类"
|
||||
title-align="start"
|
||||
v-model:visible="visible">
|
||||
@@ -61,7 +93,7 @@ const getData = async () => {
|
||||
</XSelect>
|
||||
</a-form-item>
|
||||
<a-form-item label="二级分类名称">
|
||||
<a-input v-model:model-value="form.title" placeholder="请输入二级分类名称"></a-input>
|
||||
<a-input v-model:model-value="form.name" placeholder="请输入二级分类名称"></a-input>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
|
||||
Reference in New Issue
Block a user