Digital Office Automation System
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

пре 2 недеља
пре 1 недеља
пре 2 недеља
пре 1 недеља
пре 2 недеља
пре 1 недеља
пре 2 недеља
пре 1 недеља
пре 2 недеља
пре 1 недеља
пре 2 недеља
пре 1 недеља
пре 2 недеља
пре 1 недеља
пре 2 недеља
пре 1 недеља
пре 2 недеља
пре 1 недеља
пре 2 недеља
пре 1 недеља
пре 2 недеља
пре 1 недеља
пре 2 недеља
пре 1 недеља
пре 2 недеља
пре 1 недеља
пре 2 недеља
пре 1 недеља
пре 2 недеља
пре 1 недеља
пре 2 недеља
пре 1 недеља
пре 2 недеља
пре 1 недеља
пре 2 недеља
пре 1 недеља
пре 2 недеља
пре 1 недеља
пре 2 недеља
пре 1 недеља
пре 2 недеља
пре 1 недеља
пре 2 недеља
пре 1 недеља
пре 2 недеља
пре 1 недеља
пре 2 недеља
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053
  1. <template>
  2. <div class="app-container">
  3. <el-row :gutter="10" class="mb8">
  4. <el-col :span="1.5">
  5. <el-button
  6. type="primary"
  7. plain
  8. icon="el-icon-plus"
  9. size="mini"
  10. @click="handleAdd"
  11. >新增</el-button>
  12. </el-col>
  13. <!-- <el-col :span="1.5">
  14. <el-button
  15. v-hasPermi="['demo:leave:edit']"
  16. type="success"
  17. plain
  18. icon="el-icon-edit"
  19. size="mini"
  20. :disabled="single"
  21. @click="handleUpdate"
  22. >修改</el-button>
  23. </el-col>
  24. <el-col :span="1.5">
  25. <el-button
  26. v-hasPermi="['demo:leave:remove']"
  27. type="danger"
  28. plain
  29. icon="el-icon-delete"
  30. size="mini"
  31. :disabled="multiple"
  32. @click="handleDelete"
  33. >删除</el-button>
  34. </el-col>
  35. <el-col :span="1.5">
  36. <el-button
  37. v-hasPermi="['demo:leave:export']"
  38. type="warning"
  39. plain
  40. icon="el-icon-download"
  41. size="mini"
  42. :loading="exportLoading"
  43. @click="handleExport"
  44. >导出</el-button>
  45. </el-col> -->
  46. <right-toolbar :show-search.sync="showSearch" @queryTable="getList" />
  47. </el-row>
  48. <el-table
  49. v-loading="loading"
  50. :data="areaList"
  51. @selection-change="handleSelectionChange"
  52. >
  53. <!-- <el-table-column type="selection" width="55" align="center" /> -->
  54. <el-table-column v-if="false" label="主键ID" align="center" prop="id" />
  55. <el-table-column
  56. label="地点名称"
  57. align="center"
  58. prop="name"
  59. width="180"
  60. >
  61. </el-table-column>
  62. <el-table-column label="经纬度" align="center" prop="lnglat">
  63. <template slot-scope="scope">
  64. <span
  65. style="
  66. display: inline-flex;
  67. align-items: center;
  68. justify-content: center;
  69. text-align: center;
  70. "
  71. >
  72. {{ scope.row.lng }}, {{ scope.row.lat }}
  73. </span>
  74. </template>
  75. </el-table-column>
  76. <el-table-column
  77. width="150"
  78. label="打卡半径(米)"
  79. align="center"
  80. prop="radius"
  81. >
  82. </el-table-column>
  83. <el-table-column label="状态" align="center" prop="enabled">
  84. <template slot-scope="scope">
  85. <span
  86. v-if="scope.row.enabled"
  87. :class="scope.row.enabled ? 'status-enabled' : 'status-disabled'"
  88. style="
  89. display: inline-flex;
  90. align-items: center;
  91. justify-content: center;
  92. text-align: center;
  93. "
  94. >
  95. 已启用
  96. </span>
  97. <span
  98. v-else
  99. style="
  100. display: inline-flex;
  101. align-items: center;
  102. justify-content: center;
  103. text-align: center;
  104. "
  105. >
  106. 启用
  107. </span>
  108. </template>
  109. </el-table-column>
  110. <el-table-column
  111. label="操作"
  112. align="center"
  113. width="220"
  114. class-name="small-padding fixed-width"
  115. >
  116. <template slot-scope="scope">
  117. <el-button
  118. size="mini"
  119. type="text"
  120. icon="el-icon-circle-check"
  121. @click="editArea(scope.row)"
  122. >编辑</el-button>
  123. <el-button
  124. size="mini"
  125. type="text"
  126. icon="el-icon-camera"
  127. @click="deleteArea(scope.row)"
  128. >删除</el-button>
  129. <el-button
  130. size="mini"
  131. type="text"
  132. icon="el-icon-setting"
  133. @click="toggleAreaStatus(scope.row)"
  134. :disabled="scope.row.enabled"
  135. >{{ scope.row.enabled ? '已启用' : '启用' }}</el-button>
  136. <el-button
  137. size="mini"
  138. type="text"
  139. icon="el-icon-setting"
  140. @click="forbiddenAreaStatus(scope.row)"
  141. :disabled="!scope.row.enabled"
  142. >{{ !scope.row.enabled ? '已禁用' : '禁用' }}</el-button>
  143. </template>
  144. </el-table-column>
  145. </el-table>
  146. <pagination
  147. v-show="total > 0"
  148. :total="total"
  149. :page.sync="queryParams.pageNum"
  150. :limit.sync="queryParams.pageSize"
  151. @pagination="getList"
  152. />
  153. <!-- 添加或修改对话框 -->
  154. <el-dialog :title="title" :visible.sync="open" width="960px" append-to-body>
  155. <el-form ref="form" :model="formData" label-width="80px">
  156. <el-form-item label="地点名称" prop="name" label-width="120px">
  157. <el-input v-model="formData.name" placeholder="请输入地点名称" />
  158. </el-form-item>
  159. <el-form-item label="经度" prop="lng" label-width="120px">
  160. <el-input v-model="formData.lng" placeholder="请输入经度" />
  161. </el-form-item>
  162. <el-form-item label="纬度" prop="lat" label-width="120px">
  163. <el-input v-model="formData.lat" placeholder="请输入纬度" />
  164. </el-form-item>
  165. <el-form-item label="打卡半径(米)" prop="radius" label-width="120px">
  166. <el-input v-model="formData.radius" placeholder="请输入用打卡半径(米)" />
  167. </el-form-item>
  168. <!-- <el-form-item label="用途描述" prop="descripetion">
  169. <el-input v-model="formData.descripetion" type="textarea" placeholder="请输入内容" />
  170. </el-form-item>
  171. <el-form-item label="排序权重" prop="sort">
  172. <el-input v-model="formData.sort" placeholder="请输入排序权重" />
  173. </el-form-item> -->
  174. </el-form>
  175. <!-- <div class="map-section">
  176. <h2>地图选点</h2>
  177. <div class="map-controls">
  178. <div class="control-group">
  179. <label>地点名称:</label>
  180. <input v-model="formData.name" type="text" placeholder="请输入地点名称" />
  181. </div>
  182. <div class="control-group">
  183. <label>经度:</label>
  184. <input v-model="formData.lng" type="text" placeholder="请输入经度" />
  185. </div>
  186. <div class="control-group">
  187. <label>纬度:</label>
  188. <input v-model="formData.lat" type="text" placeholder="请输入纬度" />
  189. </div>
  190. <div class="control-group">
  191. <label>打卡半径(米):</label>
  192. <input v-model.number="formData.radius" type="number" min="10" max="5000" step="10" />
  193. </div>
  194. <div class="radius-slider">
  195. <label>调整半径:</label>
  196. <input
  197. type="range"
  198. min="10"
  199. max="5000"
  200. step="10"
  201. v-model.number="formData.radius"
  202. />
  203. <span>{{ formData.radius }}米</span>
  204. </div>
  205. </div>
  206. <div class="map-actions">
  207. <button @click="clearMapSelection" class="btn-clear">
  208. <i class="fa fa-eraser"></i> 清除选择
  209. </button>
  210. <button
  211. @click="saveArea"
  212. class="btn-save"
  213. :disabled="!isFormValid"
  214. >
  215. <i class="fa fa-save"></i> 保存区域
  216. </button>
  217. </div>
  218. </div> -->
  219. <div slot="footer" class="dialog-footer">
  220. <el-button :loading="buttonLoading" type="primary" @click="saveArea">确 定</el-button>
  221. <el-button @click="cancel">取 消</el-button>
  222. </div>
  223. </el-dialog>
  224. <el-dialog title="删除对话框" :visible.sync="showDeleteModal" width="960px" append-to-body>
  225. 删除所选有可能影响打卡,是否确认删除?
  226. <div slot="footer" class="dialog-footer">
  227. <el-button :loading="buttonLoading" type="primary" @click="confirmDeleteArea">确 定</el-button>
  228. <el-button @click="cancel">取 消</el-button>
  229. </div>
  230. </el-dialog>
  231. </div>
  232. </template>
  233. <script>
  234. import {
  235. queryList,
  236. addConfig,
  237. deleteConfig,
  238. updateConfig
  239. } from '@/api/daka/daka-config'
  240. import map from '@/views/components/daka/map';
  241. export default {
  242. name: 'AttendanceAreaConfig',
  243. dicts: [
  244. 'zs_operation_warn_types',
  245. 'zs_operation_status',
  246. 'zs_operation_compare_status',
  247. 'zs_operation_platform',
  248. 'daka_check_in_status'
  249. ],
  250. data() {
  251. return {
  252. // 按钮loading
  253. buttonLoading: false,
  254. // 遮罩层
  255. loading: true,
  256. // 选中数组
  257. ids: [],
  258. // 非单个禁用
  259. single: true,
  260. // 非多个禁用
  261. multiple: true,
  262. // 显示搜索条件
  263. showSearch: true,
  264. // 总条数
  265. total: 0,
  266. // 表格数据
  267. resultList: [],
  268. // 弹出层标题
  269. title: '',
  270. // 是否显示弹出层
  271. open: false,
  272. // 图片快照时间范围
  273. daterangeWarnTime: [],
  274. // 查询参数
  275. queryParams: {
  276. pageNum: 1,
  277. pageSize: 10,
  278. sysUserName: undefined,
  279. checkInStatus: undefined,
  280. exportRange: undefined,
  281. },
  282. // 表单参数
  283. form: {},
  284. // 结果
  285. warnResult: '',
  286. // 表单校验
  287. rules: {
  288. snapshotUrl: [
  289. { required: true, message: '图片快照不能为空', trigger: 'blur' }
  290. ]
  291. },
  292. daka_check_in_status: [{label: '正常', value: '0'},{label: '迟到', value: '1'},{label: '缺卡', value: '2'}],
  293. // 地图相关
  294. map: null,
  295. marker: null,
  296. circle: null,
  297. mapHeight: '400px',
  298. baiduMapKey: '你的百度地图API Key', // 替换为你的API Key
  299. // 表单数据
  300. formData: {
  301. id: null,
  302. name: '',
  303. lng: '116.404', // 默认经度(北京天安门)
  304. lat: '39.915', // 默认纬度(北京天安门)
  305. radius: 500, // 默认半径500米
  306. enabled: false
  307. },
  308. // 区域列表
  309. areaList: [],
  310. // 模态框状态
  311. showDeleteModal: false,
  312. currentDeletingArea: null
  313. };
  314. },
  315. computed: {
  316. // 表单验证
  317. isFormValid() {
  318. return (
  319. this.formData.name.trim() !== '' &&
  320. !isNaN(parseFloat(this.formData.lng)) &&
  321. !isNaN(parseFloat(this.formData.lat)) &&
  322. this.formData.radius >= 10 &&
  323. this.formData.radius <= 5000
  324. );
  325. }
  326. },
  327. mounted() {
  328. // 加载模拟数据
  329. this.getList();
  330. // 加载地图
  331. this.loadMapScript();
  332. },
  333. methods: {
  334. /** 提交按钮 */
  335. submitForm() {
  336. this.$refs["form"].validate(valid => {
  337. if (valid) {
  338. this.buttonLoading = true;
  339. if (this.form.id != null) {
  340. updatePurpose(this.form).then(response => {
  341. this.$modal.msgSuccess("修改成功");
  342. this.open = false;
  343. this.getList();
  344. }).finally(() => {
  345. this.buttonLoading = false;
  346. });
  347. } else {
  348. addPurpose(this.form).then(response => {
  349. this.$modal.msgSuccess("新增成功");
  350. this.open = false;
  351. this.getList();
  352. }).finally(() => {
  353. this.buttonLoading = false;
  354. });
  355. }
  356. }
  357. });
  358. },
  359. // 取消按钮
  360. cancel() {
  361. this.open = false
  362. this.showDeleteModal = false
  363. // this.reset();
  364. },
  365. /** 新增按钮操作 */
  366. handleAdd() {
  367. // this.reset()
  368. this.open = true
  369. },
  370. // 多选框选中数据
  371. handleSelectionChange(selection) {
  372. this.ids = selection.map((item) => item.id)
  373. this.single = selection.length !== 1
  374. this.multiple = !selection.length
  375. },
  376. // 加载模拟数据
  377. getList() {
  378. // 这里应该从API获取数据,现在使用模拟数据
  379. // this.areaList = [
  380. // {
  381. // id: 1,
  382. // name: '总部办公楼',
  383. // lng: 116.404,
  384. // lat: 39.915,
  385. // radius: 300,
  386. // enabled: true
  387. // },
  388. // {
  389. // id: 2,
  390. // name: '研发中心',
  391. // lng: 116.414,
  392. // lat: 39.905,
  393. // radius: 200,
  394. // enabled: false
  395. // },
  396. // {
  397. // id: 3,
  398. // name: '南区仓库',
  399. // lng: 116.394,
  400. // lat: 39.925,
  401. // radius: 500,
  402. // enabled: false
  403. // }
  404. // ];
  405. queryList().then((response) => {
  406. console.log(response)
  407. this.areaList = response
  408. this.loading = false
  409. })
  410. },
  411. // 加载百度地图脚本
  412. loadMapScript() {
  413. if (window.BMapGL) {
  414. this.initMap();
  415. return;
  416. }
  417. const script = document.createElement('script');
  418. script.src = `https://api.map.baidu.com/api?type=webgl&v=1.0&ak=${this.baiduMapKey}`;
  419. // script.onload = () => {
  420. // this.initMap();
  421. // };
  422. document.body.appendChild(script);
  423. },
  424. // 初始化地图
  425. initMap() {
  426. // 创建地图实例
  427. this.map = new window.BMapGL.Map(this.$refs.mapContainer);
  428. // 设置中心点和缩放级别
  429. const point = new window.BMapGL.Point(this.formData.lng, this.formData.lat);
  430. this.map.centerAndZoom(point, 15);
  431. // 启用滚轮缩放
  432. this.map.enableScrollWheelZoom(true);
  433. // 添加常用控件
  434. this.map.addControl(new window.BMapGL.NavigationControl());
  435. this.map.addControl(new window.BMapGL.ScaleControl());
  436. // 添加地图点击事件
  437. this.map.addEventListener('click', (e) => {
  438. this.formData.lng = e.latlng.lng;
  439. this.formData.lat = e.latlng.lat;
  440. this.updateMapOverlay();
  441. });
  442. // 初始化地图覆盖物
  443. this.updateMapOverlay();
  444. },
  445. // 更新地图覆盖物(标记点和圆形区域)
  446. updateMapOverlay() {
  447. if (!this.map) return;
  448. // 清除旧的覆盖物
  449. if (this.marker) {
  450. this.map.removeOverlay(this.marker);
  451. }
  452. if (this.circle) {
  453. this.map.removeOverlay(this.circle);
  454. }
  455. // 创建新的标记点
  456. const point = new window.BMapGL.Point(this.formData.lng, this.formData.lat);
  457. this.marker = new window.BMapGL.Marker(point, {
  458. icon: new window.BMapGL.Icon(
  459. 'https://api.map.baidu.com/library/MassMarkers/1.2/src/images/m0.png',
  460. new window.BMapGL.Size(23, 25)
  461. )
  462. });
  463. // 创建圆形区域
  464. this.circle = new window.BMapGL.Circle(point, this.formData.radius, {
  465. strokeColor: '#409eff',
  466. strokeWeight: 2,
  467. strokeOpacity: 0.8,
  468. fillColor: '#409eff',
  469. fillOpacity: 0.2
  470. });
  471. // 添加覆盖物到地图
  472. this.map.addOverlay(this.marker);
  473. this.map.addOverlay(this.circle);
  474. // 地图居中到标记位置
  475. this.map.panTo(point);
  476. },
  477. // 清除地图选择
  478. clearMapSelection() {
  479. this.formData = {
  480. id: null,
  481. name: '',
  482. lng: '116.404',
  483. lat: '39.915',
  484. radius: 500,
  485. enabled: false
  486. };
  487. if (this.map) {
  488. this.updateMapOverlay();
  489. }
  490. },
  491. // 保存区域
  492. saveArea() {
  493. if (!this.isFormValid) return;
  494. const newArea = {
  495. id: this.formData.id || Date.now(), // 如果是新建,使用时间戳作为ID
  496. name: this.formData.name.trim(),
  497. lng: parseFloat(this.formData.lng),
  498. lat: parseFloat(this.formData.lat),
  499. radius: this.formData.radius,
  500. enabled: this.formData.enabled
  501. };
  502. if (this.formData.id) {
  503. // 更新现有区域
  504. const index = this.areaList.findIndex(area => area.id === this.formData.id);
  505. if (index !== -1) {
  506. this.areaList.splice(index, 1, newArea);
  507. }
  508. } else {
  509. // 添加新区域
  510. this.areaList.push(newArea);
  511. }
  512. addConfig(this.formData).then((res)=>{
  513. console.log(this.formData)
  514. console.log(res)
  515. if(res.code == 200){
  516. this.$message.success("添加成功")
  517. }
  518. this.getList()
  519. this.open = false;
  520. })
  521. // 重置表单
  522. this.clearMapSelection();
  523. },
  524. // 编辑区域
  525. editArea(area) {
  526. this.open = true
  527. // 复制对象,避免直接修改原始数据
  528. this.formData = { ...area };
  529. // 更新地图显示
  530. if (this.map) {
  531. this.updateMapOverlay();
  532. }
  533. },
  534. // 切换区域状态
  535. toggleAreaStatus(area) {
  536. if (area.enabled) {
  537. // 已启用的区域不允许禁用
  538. alert('已启用的区域不允许禁用');
  539. return;
  540. }
  541. // 启用区域
  542. const index = this.areaList.findIndex(a => a.id === area.id);
  543. if (index !== -1) {
  544. this.areaList[index].enabled = true;
  545. }
  546. area.enabled = true
  547. updateConfig(area).then((res) => {
  548. console.log(res)
  549. })
  550. },
  551. forbiddenAreaStatus(area) {
  552. // 启用区域
  553. const index = this.areaList.findIndex(a => a.id === area.id);
  554. if (index !== -1) {
  555. this.areaList[index].enabled = false;
  556. }
  557. area.enabled = false
  558. updateConfig(area).then((res) => {
  559. console.log(res)
  560. })
  561. },
  562. // 删除区域
  563. deleteArea(area) {
  564. if (area.enabled) {
  565. // 已启用的区域不允许删除
  566. alert('已启用的区域不允许删除');
  567. return;
  568. }
  569. this.currentDeletingArea = area;
  570. this.showDeleteModal = true;
  571. },
  572. // 确认删除区域
  573. confirmDeleteArea() {
  574. if (!this.currentDeletingArea) return;
  575. this.areaList = this.areaList.filter(
  576. area => area.id !== this.currentDeletingArea.id
  577. );
  578. console.log(this.currentDeletingArea)
  579. deleteConfig(this.currentDeletingArea.id).then((res)=> {
  580. console.log(res)
  581. if(res.code == 200){
  582. if(res.data == -1){
  583. this.$message.error("此配置已经被绑定,请先接解除绑定后在删除");
  584. }else{
  585. this.$message.success("删除成功")
  586. }
  587. }
  588. this.getList()
  589. })
  590. this.currentDeletingArea = null;
  591. this.showDeleteModal = false;
  592. }
  593. },
  594. beforeDestroy() {
  595. // 销毁地图实例
  596. if (this.map) {
  597. this.map.clearOverlays();
  598. this.map.removeEventListener('click');
  599. this.map = null;
  600. }
  601. }
  602. }
  603. </script>
  604. <style lang="scss">
  605. .warn-result table {
  606. width: 100% !important;
  607. }
  608. .warn-result table td a {
  609. display: none;
  610. }
  611. .warn-result table img {
  612. width: 100% !important;
  613. }
  614. .warn-result-message {
  615. .warn-result-text {
  616. font-size: 14px;
  617. color: #303133;
  618. a {
  619. color: #409eff;
  620. text-decoration: underline;
  621. }
  622. }
  623. .warn-result-tips {
  624. font-size: 12px;
  625. color: #999;
  626. margin-top: 10px;
  627. }
  628. }
  629. </style>
  630. <style lang="scss" scoped>
  631. .goods--info {
  632. display: flex;
  633. flex-direction: column;
  634. justify-content: center;
  635. text-align: left;
  636. .el-link {
  637. font-size: 14px;
  638. display: -webkit-box;
  639. -webkit-line-clamp: 2;
  640. line-clamp: 2;
  641. -webkit-box-orient: vertical;
  642. overflow: hidden;
  643. }
  644. em {
  645. font-size: 12px;
  646. color: #999;
  647. font-style: normal;
  648. }
  649. }
  650. .attendance-area-config {
  651. padding: 20px;
  652. font-family: Arial, sans-serif;
  653. max-width: 1200px;
  654. margin: 0 auto;
  655. }
  656. .page-header {
  657. text-align: center;
  658. margin-bottom: 30px;
  659. }
  660. .page-header h1 {
  661. color: #333;
  662. margin-bottom: 10px;
  663. }
  664. .page-header p {
  665. color: #666;
  666. }
  667. .content-wrapper {
  668. display: flex;
  669. gap: 20px;
  670. }
  671. .area-list {
  672. flex: 1;
  673. min-width: 400px;
  674. }
  675. .list-header {
  676. display: flex;
  677. justify-content: space-between;
  678. align-items: center;
  679. margin-bottom: 15px;
  680. }
  681. .list-header h2 {
  682. margin: 0;
  683. color: #333;
  684. }
  685. .btn-add {
  686. background-color: #409eff;
  687. color: white;
  688. border: none;
  689. padding: 8px 12px;
  690. border-radius: 4px;
  691. cursor: pointer;
  692. transition: background-color 0.3s;
  693. }
  694. .btn-add:hover {
  695. background-color: #3a8ee6;
  696. }
  697. .area-table {
  698. border: 1px solid #ddd;
  699. border-radius: 4px;
  700. overflow: hidden;
  701. }
  702. .area-table table {
  703. width: 100%;
  704. border-collapse: collapse;
  705. }
  706. .area-table th,
  707. .area-table td {
  708. padding: 10px;
  709. text-align: left;
  710. border-bottom: 1px solid #eee;
  711. }
  712. .area-table th {
  713. background-color: #f5f7fa;
  714. color: #606266;
  715. font-weight: bold;
  716. }
  717. .area-table tr:last-child td {
  718. border-bottom: none;
  719. }
  720. .area-table tr:hover {
  721. background-color: #fafafa;
  722. }
  723. .status-enabled {
  724. display: inline-block;
  725. padding: 2px 6px;
  726. background-color: #e6f7ff;
  727. color: #1890ff;
  728. border-radius: 3px;
  729. font-size: 12px;
  730. }
  731. .status-disabled {
  732. display: inline-block;
  733. padding: 2px 6px;
  734. background-color: #f5f5f5;
  735. color: #999;
  736. border-radius: 3px;
  737. font-size: 12px;
  738. }
  739. .btn-edit,
  740. .btn-status,
  741. .btn-delete {
  742. padding: 5px 10px;
  743. margin-right: 5px;
  744. border: none;
  745. border-radius: 4px;
  746. cursor: pointer;
  747. transition: background-color 0.3s;
  748. font-size: 12px;
  749. }
  750. .btn-edit {
  751. background-color: #e6f7ff;
  752. color: #1890ff;
  753. }
  754. .btn-edit:hover {
  755. background-color: #d6efff;
  756. }
  757. .btn-status {
  758. background-color: #f6ffed;
  759. color: #52c41a;
  760. }
  761. .btn-status:hover {
  762. background-color: #e8ffd9;
  763. }
  764. .btn-status:disabled {
  765. background-color: #f5f5f5;
  766. color: #999;
  767. cursor: not-allowed;
  768. }
  769. .btn-delete {
  770. background-color: #fff2f0;
  771. color: #ff4d4f;
  772. }
  773. .btn-delete:hover {
  774. background-color: #ffe5e3;
  775. }
  776. .btn-delete:disabled {
  777. background-color: #f5f5f5;
  778. color: #999;
  779. cursor: not-allowed;
  780. }
  781. .empty-state {
  782. text-align: center;
  783. padding: 50px 20px;
  784. color: #999;
  785. }
  786. .empty-state i {
  787. font-size: 40px;
  788. margin-bottom: 10px;
  789. display: block;
  790. }
  791. .map-section {
  792. flex: 1;
  793. }
  794. .map-section h2 {
  795. margin-top: 0;
  796. color: #333;
  797. }
  798. .map-controls {
  799. display: flex;
  800. flex-wrap: wrap;
  801. gap: 15px;
  802. margin-bottom: 15px;
  803. }
  804. .control-group {
  805. display: flex;
  806. align-items: center;
  807. gap: 5px;
  808. min-width: 220px;
  809. }
  810. .control-group label {
  811. font-weight: bold;
  812. min-width: 80px;
  813. }
  814. .control-group input {
  815. flex: 1;
  816. padding: 6px 10px;
  817. border: 1px solid #ddd;
  818. border-radius: 4px;
  819. }
  820. .radius-slider {
  821. width: 100%;
  822. display: flex;
  823. align-items: center;
  824. gap: 10px;
  825. }
  826. .radius-slider input[type="range"] {
  827. flex: 1;
  828. }
  829. .map {
  830. border: 1px solid #ddd;
  831. border-radius: 4px;
  832. margin-bottom: 15px;
  833. }
  834. .map-actions {
  835. display: flex;
  836. gap: 10px;
  837. }
  838. .btn-clear,
  839. .btn-save {
  840. padding: 8px 15px;
  841. border: none;
  842. border-radius: 4px;
  843. cursor: pointer;
  844. transition: background-color 0.3s;
  845. display: flex;
  846. align-items: center;
  847. gap: 5px;
  848. }
  849. .btn-clear {
  850. background-color: #f5f5f5;
  851. color: #666;
  852. }
  853. .btn-clear:hover {
  854. background-color: #eee;
  855. }
  856. .btn-save {
  857. background-color: #409eff;
  858. color: white;
  859. }
  860. .btn-save:hover {
  861. background-color: #3a8ee6;
  862. }
  863. .btn-save:disabled {
  864. background-color: #e6e6e6;
  865. color: #999;
  866. cursor: not-allowed;
  867. }
  868. .modal-overlay {
  869. position: fixed;
  870. top: 0;
  871. left: 0;
  872. width: 100%;
  873. height: 100%;
  874. background-color: rgba(0, 0, 0, 0.5);
  875. display: flex;
  876. justify-content: center;
  877. align-items: center;
  878. z-index: 1000;
  879. }
  880. .modal-content {
  881. background-color: white;
  882. border-radius: 4px;
  883. padding: 20px;
  884. width: 300px;
  885. box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  886. }
  887. .modal-content h3 {
  888. margin-top: 0;
  889. color: #333;
  890. }
  891. .modal-actions {
  892. display: flex;
  893. justify-content: flex-end;
  894. gap: 10px;
  895. margin-top: 20px;
  896. }
  897. .btn-cancel,
  898. .btn-confirm {
  899. padding: 8px 15px;
  900. border: none;
  901. border-radius: 4px;
  902. cursor: pointer;
  903. transition: background-color 0.3s;
  904. }
  905. .btn-cancel {
  906. background-color: #f5f5f5;
  907. color: #666;
  908. }
  909. .btn-cancel:hover {
  910. background-color: #eee;
  911. }
  912. .btn-confirm {
  913. background-color: #409eff;
  914. color: white;
  915. }
  916. .btn-confirm:hover {
  917. background-color: #3a8ee6;
  918. }
  919. /* 响应式设计 */
  920. @media (max-width: 900px) {
  921. .content-wrapper {
  922. flex-direction: column;
  923. }
  924. .area-list,
  925. .map-section {
  926. min-width: auto;
  927. }
  928. }
  929. @media (max-width: 500px) {
  930. .control-group {
  931. min-width: 100%;
  932. }
  933. .area-table th,
  934. .area-table td {
  935. padding: 8px 5px;
  936. font-size: 14px;
  937. }
  938. .btn-edit,
  939. .btn-status,
  940. .btn-delete {
  941. padding: 4px 6px;
  942. margin-right: 2px;
  943. }
  944. }
  945. </style>