2
0
Fork 0

代码更新

This commit is contained in:
jia 2023-12-07 18:12:21 +08:00
parent a32750bfd8
commit 1c3b963936
9 changed files with 3717 additions and 3337 deletions

View File

@ -1,4 +0,0 @@
NODE_ENV = 'development'
# Base API
VITE_APP_BASE_URL=''

View File

@ -1,3 +0,0 @@
NODE_ENV = 'production'
# Base API
VITE_APP_BASE_URL=''

26
src/api/app_update.ts Normal file
View File

@ -0,0 +1,26 @@
import request from '@/utils/request'
// app更新列表
export function apiAppUpdateLists(params: any) {
return request.get({ url: '/appUpdate/lists', params })
}
// 添加app更新
export function apiAppUpdateAdd(params: any) {
return request.post({ url: '/appUpdate/add', params })
}
// 编辑app更新
export function apiAppUpdateEdit(params: any) {
return request.post({ url: '/appUpdate/edit', params })
}
// 删除app更新
export function apiAppUpdateDelete(params: any) {
return request.post({ url: '/appUpdate/delete', params })
}
// app更新详情
export function apiAppUpdateDetail(params: any) {
return request.get({ url: '/appUpdate/detail', params })
}

View File

@ -1,14 +1,14 @@
import request from "@/utils/request"; import request from '@/utils/request'
// 订单列表 // 订单列表
export function orderList(params: any) { export function orderList(params: any) {
return request.get({ url: "/logistics.logistics/lists", params }); return request.get({ url: '/logistic.Logistic/lists', params })
} }
// http://logistics.lihaink.cn/adminapi/logistics.logistics/detail // http://logistics.lihaink.cn/adminapi/logistics.logistics/detail
// D订单详情 // D订单详情
export function orderDetil(params: any) { export function orderDetil(params: any) {
return request.get({ url: "/logistics.logistics/detail", params }); return request.get({ url: '/logistic.Logistic/detail', params })
} }

View File

@ -1,12 +1,12 @@
const config = { const config = {
terminal: 1, //终端 terminal: 1, //终端
title: "后台管理系统", //网站默认标题 title: '后台管理系统', //网站默认标题
version: "1.6.0", //版本号 version: '1.6.0', //版本号
baseUrl: `${import.meta.env.VITE_APP_BASE_URL || ""}/`, //请求接口域名 baseUrl: `${import.meta.env.VITE_APP_BASE_URL || ''}/`, //请求接口域名
urlPrefix: "adminapi", //请求默认前缀 urlPrefix: 'adminapi', //请求默认前缀
timeout: 10 * 1000, //请求超时时 timeout: 10 * 1000 //请求超时时
}; }
export default config; export default config
// const config = { // const config = {
// terminal: 1, //终端 // terminal: 1, //终端
// title: "后台管理系统", //网站默认标题 // title: "后台管理系统", //网站默认标题

View File

@ -0,0 +1,170 @@
<template>
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="550px" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="120px" :rules="formRules">
<el-form-item label="标题" prop="title">
<el-input v-model="formData.title" clearable placeholder="请输入标题" />
</el-form-item>
<el-form-item label="内容" prop="content">
<el-input v-model="formData.content" clearable placeholder="请输入内容" type="textarea" autosize />
</el-form-item>
<el-form-item label="APP类型" prop="type">
<el-radio-group v-model="formData.type" placeholder="请选择APP类型">
<el-radio v-for="(item, index) in dictData.app_type" :key="index" :label="parseInt(item.value)">
{{ item.name }}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="版本" prop="version">
<el-input v-model="formData.version" clearable placeholder="请输入版本,例如1.0.1" />
</el-form-item>
<!-- <el-form-item label="更新包文件" prop="dow_url">
<el-upload class="upload-demo" style="width: 100%" drag accept=".apk, .ipa, .wgt" :headers="{ Token: userStore.token }" :action="base_url + '/upload/file'" :limit="1" :on-success="handleFile" :on-exceed="handleExceed" :before-upload="handleBeforeUpload" ref="upload">
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
<div class="el-upload__text">文件拖入或点击上传</div>
<template #tip>
<div class="el-upload__tip">请上传APK/IPA/WGT文件</div>
</template>
</el-upload>
</el-form-item> -->
<el-form-item label="下载地址" prop="dow_url">
<el-input v-model="formData.dow_url" placeholder="请输入文件地址" />
</el-form-item>
<el-form-item label="是否强制更新" prop="force">
<el-radio-group v-model="formData.force" placeholder="请选择是否强制更新">
<el-radio v-for="(item, index) in dictData.app_force_quiet" :key="index" :label="parseInt(item.value)">
{{ item.name }}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="是否静默更新" prop="quiet">
<el-radio-group v-model="formData.quiet" placeholder="请选择是否静默更新">
<el-radio v-for="(item, index) in dictData.app_force_quiet" :key="index" :label="parseInt(item.value)">
{{ item.name }}
</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="appUpdateEdit">
import type { FormInstance } from "element-plus";
import { genFileId } from "element-plus";
import Popup from "@/components/popup/index.vue";
import {
apiAppUpdateAdd,
apiAppUpdateEdit,
apiAppUpdateDetail,
} from "@/api/app_update";
import { timeFormat } from "@/utils/util";
import type { PropType } from "vue";
import { inject } from "vue";
const base_url: any = inject("base_url");
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
default: () => ({}),
},
});
const emit = defineEmits(["success", "close"]);
const formRef = shallowRef<FormInstance>();
const popupRef = shallowRef<InstanceType<typeof Popup>>();
const mode = ref("add");
import useUserStore from "@/stores/modules/user";
const userStore = useUserStore();
const handleFile = (e: any) => {
formData.dow_url = e.data.uri;
};
const upload = ref(null);
const handleExceed = (files: any) => {
upload.value!.clearFiles();
const file = files[0] as UploadRawFile;
file.uid = genFileId();
upload.value!.handleStart(file);
upload.value!.submit();
};
const appTypeList = [".apk", ".ipa", ".wgt"];
const handleBeforeUpload = (e: any) => {
const a = appTypeList.find((item: any) => {
return item == e?.name?.substring(e.name.length - 4, e.name.length);
});
if (a) return true;
else {
ElMessage.error("仅支持上传APK/IPA/WGT文件");
return false;
}
};
//
const popupTitle = computed(() => {
return mode.value == "edit" ? "编辑app更新" : "新增app更新";
});
//
const formData = reactive({
id: "",
title: "",
content: "",
type: "",
version: "",
dow_url: "",
force: "",
quiet: "",
});
//
const formRules = reactive<any>({});
//
const setFormData = async (data: Record<any, any>) => {
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
formData[key] = data[key];
}
}
};
const getDetail = async (row: Record<string, any>) => {
const data = await apiAppUpdateDetail({
id: row.id,
});
setFormData(data);
};
//
const handleSubmit = async () => {
await formRef.value?.validate();
const data = { ...formData };
mode.value == "edit"
? await apiAppUpdateEdit(data)
: await apiAppUpdateAdd(data);
popupRef.value?.close();
emit("success");
};
//
const open = (type = "add") => {
mode.value = type;
popupRef.value?.open();
};
//
const handleClose = () => {
emit("close");
};
defineExpose({
open,
setFormData,
getDetail,
});
</script>

View File

@ -0,0 +1,144 @@
<template>
<div>
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
<el-button v-perms="['app_update/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button v-perms="['app_update/delete']" :disabled="!selectData.length" @click="handleDelete(selectData)">
删除
</el-button>
<div class="mt-4">
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" />
<el-table-column label="标题" prop="title" show-overflow-tooltip />
<el-table-column label="内容" prop="content" show-overflow-tooltip />
<el-table-column label="APP类型" prop="type">
<template #default="{ row }">
{{ row.force == 1 ? 'IOS' : '安卓' }}
</template>
</el-table-column>
<el-table-column label="版本" prop="version" show-overflow-tooltip />
<el-table-column label="app链接" prop="dow_url" show-overflow-tooltip />
<el-table-column label="是否强制更新" prop="force">
<template #default="{ row }">
{{ row.force == 1 ? '是' : '否' }}
</template>
</el-table-column>
<el-table-column label="是否静默更新" prop="quiet">
<template #default="{ row }">
{{ row.quiet == 1 ? '是' : '否' }}
</template>
</el-table-column>
<el-table-column label="更新时间" prop="update_time" show-overflow-tooltip />
<el-table-column label="操作" width="120" fixed="right">
<template #default="{ row }">
<el-button v-perms="['app_update/edit']" type="primary" link @click="handleEdit(row)">
编辑
</el-button>
<el-button v-perms="['app_update/delete']" type="danger" link @click="handleDelete(row.id)">
删除
</el-button>
</template>
</el-table-column>
</el-table>
</div>
<div class="flex mt-4 justify-end">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
</div>
</template>
<script lang="ts" setup name="appUpdateLists">
import { usePaging } from "@/hooks/usePaging";
import { useDictData } from "@/hooks/useDictOptions";
import { apiAppUpdateLists, apiAppUpdateDelete } from "@/api/app_update";
import { timeFormat } from "@/utils/util";
import feedback from "@/utils/feedback";
import EditPopup from "./edit.vue";
const editRef = shallowRef<InstanceType<typeof EditPopup>>();
//
const showEdit = ref(false);
//
const queryParams = reactive({
title: "",
content: "",
type: "",
version: "",
dow_url: "",
force: "",
quiet: "",
});
//
const selectData = ref<any[]>([]);
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id);
};
const { dictData } = {
dictData: {
app_force_quiet: [
{
name: "是",
value: 1,
},
{
name: "否",
value: 0,
},
],
app_type: [
{
name: "IOS",
value: 1,
},
{
name: "安卓",
value: 2,
},
],
},
};
//
// const { dictData } = useDictData("app_type,app_force_quiet");
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiAppUpdateLists,
params: queryParams,
});
//
const handleAdd = async () => {
showEdit.value = true;
await nextTick();
editRef.value?.open("add");
};
//
const handleEdit = async (data: any) => {
showEdit.value = true;
await nextTick();
editRef.value?.open("edit");
editRef.value?.setFormData(data);
};
//
const handleDelete = async (id: number | any[]) => {
await feedback.confirm("确定要删除?");
await apiAppUpdateDelete({ id });
getLists();
};
getLists();
</script>

View File

@ -1,14 +1,25 @@
<template> <template>
<div> <div>
<el-card class="!border-none" v-loading="pager.loading" shadow="never"> <el-card class="!border-none" v-loading="pager.loading" shadow="never">
<el-form class="mb-[-16px]" inline> <el-form class="mb-[-16px]" inline>
<el-form-item label="订单编号" prop="company_id"> <el-form-item label="订单编号" prop="company_id">
<el-input class="w-[280px]" v-model="queryParams.order_sn" clearable placeholder="请输入订单编号" /> <el-input class="w-[280px]" v-model="queryParams.order_sn" clearable placeholder="请输入订单编号" />
</el-form-item> </el-form-item>
<el-form-item label="商家名称" prop="company_id"> <el-form-item label="商家名称" prop="company_id">
<el-input class="w-[280px]" v-model="queryParams.shop_name" clearable placeholder="请输入商家名称" /> <el-input class="w-[280px]" v-model="queryParams.shop_name" clearable placeholder="请输入商家名称" />
</el-form-item> </el-form-item>
<el-form-item label="商家电话" prop="company_id"> <el-form-item label="下单用户名称" prop="company_id">
<el-input class="w-[280px]" v-model="queryParams.user_name" clearable placeholder="请输入商家名称" />
</el-form-item>
<el-form-item label="配送人员" prop="company_id">
<el-input class="w-[280px]" v-model="queryParams.courier_name" clearable placeholder="请输入配送人员姓名" />
</el-form-item>
<el-form-item label="订单状态" prop="status">
<el-select class="flex-1" v-model="queryParams.status" clearable placeholder="请选择岗位">
<el-option v-for="(item, index) in optionsData" :key="index" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<!-- <el-form-item label="商家电话" prop="company_id">
<el-input class="w-[280px]" v-model="queryParams.shop_phone" clearable placeholder="请输入商家电话" /> <el-input class="w-[280px]" v-model="queryParams.shop_phone" clearable placeholder="请输入商家电话" />
</el-form-item> </el-form-item>
<el-form-item label="商家地址" prop="company_id"> <el-form-item label="商家地址" prop="company_id">
@ -20,58 +31,53 @@
<el-form-item label="收件人电话" prop="company_id"> <el-form-item label="收件人电话" prop="company_id">
<el-input class="w-[280px]" v-model="queryParams.receiver_phone" clearable placeholder="请输入收件人电话" /> <el-input class="w-[280px]" v-model="queryParams.receiver_phone" clearable placeholder="请输入收件人电话" />
</el-form-item> </el-form-item> -->
<el-form-item label="配送人员" prop="company_id"> <!--
<el-input class="w-[280px]" v-model="queryParams.courier_name" clearable placeholder="请输入配送人员姓名" /> <el-form-item label="所属公司" prop="company_id">
</el-form-item> <el-input class="w-[280px]" v-model="queryParams.courier_company" clearable placeholder="请输入所属公司地址" />
<el-form-item label="所属公司" prop="company_id"> </el-form-item>
<el-input class="w-[280px]" v-model="queryParams.courier_company" clearable placeholder="请输入所属公司地址" /> <el-form-item label="村/镇/小队" prop="company_id">
</el-form-item> <el-input class="w-[280px]" v-model="queryParams.receiver_address" clearable placeholder="请输入村/镇/小队" />
<el-form-item label="村/镇/小队" prop="company_id"> </el-form-item> -->
<el-input class="w-[280px]" v-model="queryParams.receiver_address" clearable placeholder="请输入村/镇/小队" /> <el-form-item>
</el-form-item> <el-button type="primary" @click="resetPage">查询</el-button>
<el-form-item> <el-button @click="resetParams">重置</el-button>
<el-button type="primary" @click="resetPage">查询</el-button> </el-form-item>
<el-button @click="resetParams">重置</el-button> </el-form>
</el-form-item> <div class="mt-4">
</el-form> <el-table :data="pager.lists" :default-sort="{ prop: 'create_time', order: 'descending' }" @selection-change="handleSelectionChange">
<div class="mt-4"> <el-table-column label="订单编号" :width="250" prop="order_sn" show-overflow-tooltip />
<el-table :data="pager.lists" :default-sort="{ prop: 'create_time', order: 'descending' }" <el-table-column label="商户名称" prop="shop_name" show-overflow-tooltip />
@selection-change="handleSelectionChange"> <el-table-column label="收货人" prop="receiver_name" show-overflow-tooltip />
<el-table-column label="收货人号码" prop="receiver_phone" show-overflow-tooltip />
<el-table-column label="收货地址" prop="receiver_address" show-overflow-tooltip />
<el-table-column label="商品数量" prop="product_count" align="center" show-overflow-tooltip />
<el-table-column label="订单编号" :width="250" prop="order_sn" show-overflow-tooltip /> <el-table-column label="下单时间" sortable prop="create_time" show-overflow-tooltip />
<el-table-column label="商户名称" prop="shop_name" show-overflow-tooltip />
<el-table-column label="收货人" prop="receiver_name" show-overflow-tooltip />
<el-table-column label="收货人号码" prop="receiver_phone" show-overflow-tooltip />
<el-table-column label="收货地址" prop="receiver_address" show-overflow-tooltip />
<el-table-column label="商品数量" prop="product_count" align="center" show-overflow-tooltip />
<el-table-column label="下单时间" sortable prop="create_time" show-overflow-tooltip /> <el-table-column label="订单状态" :filters="[
{ text: '待取货', value: '0' },
{ text: '配送中', value: '1' },
{ text: '已配送', value: '2' },
{ text: '已取消', value: '3' }
]" :filter-method="filterHandler" prop="status_name" show-overflow-tooltip>
</el-table-column>
<el-table-column label="订单状态" :filters="[ <el-table-column label="配送人员" prop="courier_name" show-overflow-tooltip />
{ text: '待取货', value: '0' }, <el-table-column label="配送人员所属公司" prop="courier_company" show-overflow-tooltip />
{ text: '配送中', value: '1' }, <el-table-column label="操作" align="center" width="auto" fixed="right">
{ text: '已配送', value: '2' }, <template #default="{ row }">
{ text: '已取消', value: '3' }, <el-button type="primary" v-perms="['logistics.logistics/detail']" link @click="handleView(row)">查看</el-button>
]" :filter-method="filterHandler" prop="status_name" show-overflow-tooltip> </template>
</el-table-column> </el-table-column>
</el-table>
<el-table-column label="配送人员" prop="courier_name" show-overflow-tooltip /> </div>
<el-table-column label="配送人员所属公司" prop="courier_company" show-overflow-tooltip /> <div class="flex mt-4 justify-end">
<el-table-column label="操作" align="center" width="auto" fixed="right"> <pagination v-model="pager" @change="getLists" />
<template #default="{ row }"> </div>
<el-button type="primary" v-perms="['logistics.logistics/detail']" link </el-card>
@click="handleView(row)">查看</el-button> <edit-popup v-if="showEdit" ref="editRef" @success="getLists" @close="showEdit = false" />
</template> </div>
</el-table-column>
</el-table>
</div>
<div class="flex mt-4 justify-end">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
<edit-popup v-if="showEdit" ref="editRef" @success="getLists" @close="showEdit = false" />
</div>
</template> </template>
<script lang="ts" setup name="flowTypeLists"> <script lang="ts" setup name="flowTypeLists">
@ -80,49 +86,75 @@ import { useDictData } from "@/hooks/useDictOptions";
import { orderList } from "@/api/logistics"; import { orderList } from "@/api/logistics";
import EditPopup from "./edit.vue"; import EditPopup from "./edit.vue";
interface User { interface User {
date: string; date: string;
name: string; name: string;
address: string; address: string;
tag: string; tag: string;
} }
const editRef = shallowRef<InstanceType<typeof EditPopup>>(); const editRef = shallowRef<InstanceType<typeof EditPopup>>();
// //
const showEdit = ref(false); const showEdit = ref(false);
// //
// 'order_sn' =>,'shop_name'=> ,'shop_phone' => ,'shop_address' => ,'user_name' => ,'user_address' => ,'user_phone' => // 'order_sn' =>,'shop_name'=> ,'shop_phone' => ,'shop_address' => ,'user_name' => ,'user_address' => ,'user_phone' =>
const queryParams = reactive({ const queryParams = reactive({
order_sn: "", order_sn: "",
shop_name: "", shop_name: "",
shop_phone: "",
shop_address: "", user_name: "",
receiver_name: "", shop_address: "",
receiver_address: "", courier_name: "",
receiver_phone: "", status,
courier_name: "", // receiver_address: "",
courier_company: "", // receiver_phone: "",
// courier_name: "",
// courier_company: "",
}); });
const optionsData = reactive([
{
name: "待揽件",
id: 0,
},
{
name: "配送中",
id: 1,
},
{
name: "已配送",
id: 2,
},
{
name: "已完成",
id: 3,
},
{
name: "已取消",
id: 4,
},
]);
// //
const selectData = ref<any[]>([]); const selectData = ref<any[]>([]);
// //
const handleSelectionChange = (val: any[]) => { const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id); selectData.value = val.map(({ id }) => id);
}; };
const filterHandler = (value: string, row: any, column: any) => { const filterHandler = (value: string, row: any, column: any) => {
return row.status == value; return row.status == value;
}; };
// //
const { dictData } = useDictData(""); const { dictData } = useDictData("");
// //
const { pager, getLists, resetParams, resetPage } = usePaging({ const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: orderList, fetchFun: orderList,
params: queryParams, params: queryParams,
}); });
const handleView = async (data: any) => { const handleView = async (data: any) => {
showEdit.value = true; showEdit.value = true;
await nextTick(); await nextTick();
editRef.value?.open(data.id); editRef.value?.open(data.id);
}; };
getLists(); getLists();
</script> </script>

6497
yarn.lock

File diff suppressed because it is too large Load Diff