diff --git a/src/components/area-common/Map.vue b/src/components/area-common/Map.vue
deleted file mode 100644
index af1251d..0000000
--- a/src/components/area-common/Map.vue
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/components/area-common/Search.vue b/src/components/area-common/Search.vue
deleted file mode 100644
index b303582..0000000
--- a/src/components/area-common/Search.vue
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
-
-
-
-
-
- 查询
-
-
-
-
-
-
diff --git a/src/components/area-common/Table.vue b/src/components/area-common/Table.vue
deleted file mode 100644
index 2bb176c..0000000
--- a/src/components/area-common/Table.vue
+++ /dev/null
@@ -1,86 +0,0 @@
-
-
-
-
-
- {{ zone }}已有服务区域
-
-
-
-
-
-
-
- 定位
- 删除
-
-
-
-
-
-
-
-
-
diff --git a/src/components/area-common/hooks/useServiceArea.ts b/src/components/area-common/hooks/useServiceArea.ts
deleted file mode 100644
index 1cf4bf3..0000000
--- a/src/components/area-common/hooks/useServiceArea.ts
+++ /dev/null
@@ -1,263 +0,0 @@
-import { nextTick, type Ref, unref, watch } from "vue"
-import { useRequest } from "@/hooks/useFetchData"
-import { usePaging } from "@/hooks/usePaging"
-import { addArea, apiMapLocation, delArea, getAreaListByLocation, getLonAndLatByArea } from "@/api/service/area"
-import type { Pager, Location } from '@/config/symbol'
-import { VITE_MAP_KEY } from "@/config/env"
-import { toast } from "@/utils/util"
-
-/**用户操作 */
-export function useAreaOperation(inited = true) {
- const areaSearch = ref()
- const tcMap = ref()
- const zone = ref('') //地区
- const regionCode = ref() //地区编码
- const base = ref>() //区域列表信息
- const address = ref() //当前地址信息
- const isInited = ref(true) //初始化
-
- // 查询
- const handleSearch = (form: any) => {
- const params = {
- address: encodeURIComponent(form.area.join('')),
- key: VITE_MAP_KEY
- }
- const { runFn } = useRequest({
- apiFn: getLonAndLatByArea,
- onSuccess(response) {
- const { result: { location, address_components, ad_info } } = response
- searchCommon({ location, address_components, ad_info })
- },
- })
- runFn(params)
- }
- // 查询后操作
- const searchCommon = (payload: any) => {
- const { location, address_components, ad_info } = payload
- if (isInited.value) {
- tcMap.value?.setMapCenter(location)
- areaSearch.value?.setCascaderValue(address_components)
- }
- address.value = payload
- zone.value = address_components.district
- regionCode.value = ad_info.adcode
- fetchAreaList()
- }
- // 添加区域
- const increment = async (payload: any) => {
- const { runFn } = useRequest({
- apiFn: addArea,
- onSuccess(response) {
- tcMap.value.removePolygon()
- toast('添加成功', 'success')
- fetchAreaList()
- },
- })
- runFn(payload)
- }
- /**获取区域列表 */
- const fetchAreaList = async () => {
- const params = {
- regionId: regionCode.value
- }
- const { pager, getLists } = usePaging({
- fetchFun: getAreaListByLocation,
- params
- })
- await getLists()
- base.value = Object.assign(pager, {
- getLists
- })
- }
- /**初始化当前位置 */
- const initPosition = async () => {
- const params = { key: VITE_MAP_KEY }
- const { runFn } = useRequest({
- apiFn: apiMapLocation,
- onSuccess(response) {
- const { result: { location, ad_info } } = response
- searchCommon({ location, address_components: ad_info, ad_info })
- }
- })
- runFn(params)
- isInited.value = inited
- }
-
- onMounted(initPosition)
-
- return {
- tcMap,
- areaSearch,
- zone,
- regionCode,
- increment,
- searchCommon,
- handleSearch,
- base,
- address,
- isInited
- }
-}
-
-/**表格操作 */
-export function useAreaTableOperation({ tcMap, base, aTable }: { tcMap: any, base: Ref, aTable: any }) {
-
- /**选中 */
- const toggleRowSelection = (selectData: any[]) => {
- const tableData = base.value.lists
- const selectedIds = selectData?.map(item => item.id) as number[]
- const selectedList = tableData.filter(data => selectedIds.includes(data.id))
-
- tableData.forEach(data => {
- aTable.value.tableRef.toggleRowSelection(data, false)
- })
- selectedList.forEach(row => {
- aTable.value.tableRef.toggleRowSelection(row, true)
- })
- }
- /**定位 */
- const handleLocation = (row: any) => {
- const convertPolygons = row.polygongeo.replace("POLYGON((", '').replace("))", '').split(',')
- const polygonPaths = convertPolygons.map((path: string) => {
- const [lng, lat] = path.split(' ')
- return {
- lat: parseFloat(lat),
- lng: parseFloat(lng)
- }
- })
-
- tcMap.value.initPolygon({
- polygonId: row.id,
- polygonPaths
- })
- }
- /**删除 */
- const handleDelete = async (id: number) => {
- const { runFn } = useRequest({
- apiFn: delArea,
- onSuccess(response) {
- toast('删除成功', 'success')
- base.value.getLists()
- }
- })
- runFn({ id })
- }
-
- return {
- handleLocation,
- handleDelete,
- toggleRowSelection,
- }
-}
-
-/**地图 */
-export function useAreaMapOperation(parentApi: any) {
-
- let map, polygon, editor;
- const TMap = (window as any).TMap
-
- const mapRef = ref()
- const drawId = ref([])
-
- /**初始化地图 */
- function initMap() {
- map = new TMap.Map(mapRef.value, {
- zoom: 12,
- viewMode: '2D'
- })
- }
- /**设置地图中心 */
- function setMapCenter(location: Location) {
- const { lat, lng } = location
- map!.setCenter(new TMap.LatLng(lat, lng))
- }
- /**绘制多边形 */
- const drawPolygon = () => {
- polygon = new TMap.MultiPolygon({
- map: map
- })
- editor = new TMap.tools.GeometryEditor({
- map: map,
- overlayList: [
- {
- overlay: polygon,
- id: 'polygon',
- }
- ],
- actionMode: TMap.tools.constants.EDITOR_ACTION.DRAW, // 编辑器的工作模式
- activeOverlayId: 'polygon', // 激活图层
- snappable: true,
- })
- editor.on('draw_complete', geometry => {
- drawId.value.push(geometry.id)
- geometry.paths.splice(geometry.paths.length, 0, geometry.paths[0])
- parentApi?.showDialog({
- polygonPaths: geometry.paths
- })
- })
- }
- /**表格定位=>初始化多边形 */
- function initPolygon({ polygonId, polygonPaths }: { polygonId: number, polygonPaths: Location[] }) {
-
- if (polygonId === polygon?.id) return
-
- polygon = new TMap.MultiPolygon({
- id: polygonId, // 图层id
- map: map, // 显示多边形图层的底图
- styles: {
- // 多边形的相关样式
- polygon: new TMap.PolygonStyle({
- color: 'rgb(250, 250, 122)', // 面填充色
- showBorder: false, // 是否显示拔起面的边线
- borderColor: '#00FFFF', // 边线颜色
- }),
- },
- geometries: [
- {
- id: 'polygon', // 多边形图形数据的标志信息
- styleId: 'polygon', // 样式id
- paths: polygonPaths, // 多边形的位置信息
- properties: {
- // 多边形的属性数据
- title: 'polygon',
- },
- },
- ],
- })
- }
- /**移除多边形 (先选中再删除)*/
- function removePolygon() {
- editor!.setActionMode(TMap.tools.constants.EDITOR_ACTION.INTERACT).select(drawId.value).setSelectable(true)
- editor!.delete()
- }
-
- onMounted(() => {
- nextTick(initMap)
- })
-
- return {
- mapRef,
- setMapCenter,
- drawPolygon,
- removePolygon,
- initPolygon
- }
-}
-
-/**弹框 */
-export function useDialogOperation(regionCode: Ref) {
- const infoDialogRef = ref()
-
- function showDialog(payload: any) {
- const params = {
- title: '绘制确认',
- rawData: { ...payload, regionCode: regionCode.value }
- }
- infoDialogRef.value.acceptParams(params)
- }
-
- return {
- infoDialogRef,
- showDialog
- }
-}
\ No newline at end of file
diff --git a/src/components/area-common/styles/area.scss b/src/components/area-common/styles/area.scss
deleted file mode 100644
index 6e2afea..0000000
--- a/src/components/area-common/styles/area.scss
+++ /dev/null
@@ -1,12 +0,0 @@
-.area {
- display: grid;
- grid-template-columns: 1fr;
- grid-template-rows: 50px minmax(100px, auto);
- gap: 20px;
-
- &__part {
- display: grid;
- grid-template-columns: 1fr minmax(400px, 1fr);
- gap: 20px;
- }
-}
\ No newline at end of file
diff --git a/src/components/area-common/styles/map.scss b/src/components/area-common/styles/map.scss
deleted file mode 100644
index 2ef690d..0000000
--- a/src/components/area-common/styles/map.scss
+++ /dev/null
@@ -1,36 +0,0 @@
-.map {
- position: relative;
- flex: 1;
-
- &__inner {
- width: 100%;
- height: 100%;
- }
-
- #toolControl {
- position: absolute;
- top: 10px;
- left: 0px;
- right: 0px;
- margin: auto;
- width: 252px;
- z-index: 1001;
-
- .toolItem {
- width: 30px;
- height: 30px;
- float: left;
- margin: 1px;
- padding: 4px;
- border-radius: 3px;
- background-size: 30px 30px;
- background-position: 4px 4px;
- background-repeat: no-repeat;
- box-shadow: 0 1px 2px 0 #e4e7ef;
- background-color: #ffffff;
- border: 1px solid #ffffff;
- background-image: url('https://mapapi.qq.com/web/lbs/javascriptGL/demo/img/polygon.png');
- background-position: center;
- }
- }
-}
\ No newline at end of file
diff --git a/src/components/area-select/index.vue b/src/components/area-select/index.vue
deleted file mode 100644
index 1471e37..0000000
--- a/src/components/area-select/index.vue
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/components/channel-select-user/channel-popup.vue b/src/components/channel-select-user/channel-popup.vue
deleted file mode 100644
index b8a72fd..0000000
--- a/src/components/channel-select-user/channel-popup.vue
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/components/channel-select-user/distributeTable.vue b/src/components/channel-select-user/distributeTable.vue
deleted file mode 100644
index 28e2424..0000000
--- a/src/components/channel-select-user/distributeTable.vue
+++ /dev/null
@@ -1,107 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 查询
- 重置
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/components/channel-select-user/index.vue b/src/components/channel-select-user/index.vue
deleted file mode 100644
index 62dbc29..0000000
--- a/src/components/channel-select-user/index.vue
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
diff --git a/src/components/channel-select-user/table-detail.vue b/src/components/channel-select-user/table-detail.vue
deleted file mode 100644
index f9bca6a..0000000
--- a/src/components/channel-select-user/table-detail.vue
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-
-
-
-
-
-
-
- 移除
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/components/channel-select-user/userTable.vue b/src/components/channel-select-user/userTable.vue
deleted file mode 100644
index 3690f66..0000000
--- a/src/components/channel-select-user/userTable.vue
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
-
-
-
-
- 搜索
- 重置
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/components/footer-btns/index.vue b/src/components/footer-btns/index.vue
deleted file mode 100644
index fd7fe5b..0000000
--- a/src/components/footer-btns/index.vue
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/components/good-select/good-popup.vue b/src/components/good-select/good-popup.vue
deleted file mode 100644
index a414eed..0000000
--- a/src/components/good-select/good-popup.vue
+++ /dev/null
@@ -1,191 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 搜索
- 重置
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/components/good-select/index.vue b/src/components/good-select/index.vue
deleted file mode 100644
index 6aaf9b9..0000000
--- a/src/components/good-select/index.vue
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/src/components/good-select/table-detail.vue b/src/components/good-select/table-detail.vue
deleted file mode 100644
index 9ea98a0..0000000
--- a/src/components/good-select/table-detail.vue
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
- {{ scope.row.name }}
-
-
-
-
-
-
-
-
- 移除
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/components/money-detail/moneyDetailDialog.vue b/src/components/money-detail/moneyDetailDialog.vue
deleted file mode 100644
index a66065d..0000000
--- a/src/components/money-detail/moneyDetailDialog.vue
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
- {{ btnText }}
-
-
-
-
-
- 元
-
-
-
-
- 元
-
-
-
-
- 元
-
-
-
-
-
-
-
diff --git a/src/components/service-area/index.vue b/src/components/service-area/index.vue
deleted file mode 100644
index e385897..0000000
--- a/src/components/service-area/index.vue
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-
-
-
-
diff --git a/src/components/service-area/table-detail.vue b/src/components/service-area/table-detail.vue
deleted file mode 100644
index fd369ee..0000000
--- a/src/components/service-area/table-detail.vue
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
-
-
-
-
-
- 移除
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/components/service-select/index.vue b/src/components/service-select/index.vue
deleted file mode 100644
index d1eb95d..0000000
--- a/src/components/service-select/index.vue
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/components/service-select/service-popup.vue b/src/components/service-select/service-popup.vue
deleted file mode 100644
index 3fe4e35..0000000
--- a/src/components/service-select/service-popup.vue
+++ /dev/null
@@ -1,170 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 搜索
- 重置
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ scope.row.name }}
-
-
-
-
-
-
-
-
-
- 销售中
- 仓库中
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/components/service-select/table-detail.vue b/src/components/service-select/table-detail.vue
deleted file mode 100644
index 4fe6172..0000000
--- a/src/components/service-select/table-detail.vue
+++ /dev/null
@@ -1,91 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
- {{ scope.row.name }}
-
-
-
-
-
-
-
-
-
- 销售中
- 仓库中
-
-
-
-
-
-
- 移除
-
-
-
-
-
-
-
-
-
-