综合办公系统
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.

instrumentsList.vue 25KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939
  1. <!--
  2. * @Author: ysh
  3. * @Date: 2025-07-08 14:00:47
  4. * @LastEditors: Please set LastEditors
  5. * @LastEditTime: 2025-07-16 15:22:13
  6. -->
  7. <template>
  8. <view class="device-container">
  9. <!-- 顶部搜索栏 -->
  10. <view class="search-section">
  11. <view class="search-bar">
  12. <view class="search-input-wrapper">
  13. <uni-icons type="search" size="16" color="#999"></uni-icons>
  14. <input class="search-input" v-model="queryParams.name" placeholder="搜索设备名称" @confirm="handleQuery"
  15. @input="handleSearchInput" />
  16. <uni-icons v-if="queryParams.name" type="clear" size="16" color="#999" @click="clearSearch"></uni-icons>
  17. </view>
  18. </view>
  19. <!-- 筛选条件 -->
  20. <view class="filter-section" v-if="showFilter">
  21. <view class="filter-row">
  22. <view class="filter-item">
  23. <text class="filter-label">设备状态</text>
  24. <uni-data-select v-model="queryParams.status" :localdata="statusOptions" placeholder="全部状态"
  25. @change="handleQuery" />
  26. </view>
  27. <view class="filter-item">
  28. <text class="filter-label">设备品牌</text>
  29. <input v-model="queryParams.brand" placeholder="品牌筛选" @confirm="handleQuery" />
  30. </view>
  31. </view>
  32. <view class="filter-row">
  33. <view class="filter-item">
  34. <text class="filter-label">出厂编号</text>
  35. <input v-model="queryParams.code" placeholder="编号筛选" @confirm="handleQuery" />
  36. </view>
  37. <view class="filter-item">
  38. <text class="filter-label">规格型号</text>
  39. <input v-model="queryParams.series" placeholder="型号筛选" @confirm="handleQuery" />
  40. </view>
  41. </view>
  42. </view>
  43. <!-- 筛选按钮 -->
  44. <view class="filter-toggle" @click="toggleFilter">
  45. <text>筛选</text>
  46. <uni-icons :type="showFilter ? 'up' : 'down'" size="14" color="#666"></uni-icons>
  47. </view>
  48. </view>
  49. <!-- 设备列表 -->
  50. <scroll-view :scroll-top="scrollTop" scroll-y="true" class="device-list" @scrolltoupper="upper"
  51. @scrolltolower="lower" @scroll="scroll" :refresher-enabled="true" :refresher-triggered="isRefreshing"
  52. @refresherrefresh="onRefresh" :lower-threshold="50" :upper-threshold="50">
  53. <view class="content-wrapper">
  54. <template v-if="deviceList.length > 0">
  55. <view class="device-card" v-for="(item, index) in deviceList" :key="index" @click="handleViewDetail(item)">
  56. <view class="device-header">
  57. <view class="device-info">
  58. <text class="device-name">{{ item.name }}</text>
  59. <text class="device-brand">{{ item.brand }}</text>
  60. </view>
  61. <view class="device-status">
  62. <uni-tag :text="statusTypeText(item.status)" :type="statusTypeStyle(item.status)" size="small" />
  63. </view>
  64. </view>
  65. <view class="device-content">
  66. <view class="info-row">
  67. <text class="info-label">设备编号:</text>
  68. <text class="info-value">{{ item.deviceNumber || '暂无' }}</text>
  69. </view>
  70. <view class="info-row">
  71. <text class="info-label">规格型号:</text>
  72. <text class="info-value">{{ item.series || '暂无' }}</text>
  73. </view>
  74. <view class="info-row">
  75. <text class="info-label">出厂编号:</text>
  76. <text class="info-value">{{ item.code || '暂无' }}</text>
  77. </view>
  78. <view class="info-row">
  79. <text class="info-label">购置时间:</text>
  80. <text class="info-value">{{ formatDate(item.acquisitionTime) }}</text>
  81. </view>
  82. <view class="info-row">
  83. <text class="info-label">购买价格:</text>
  84. <text class="info-value price">¥{{ item.cost || '0' }}</text>
  85. </view>
  86. <view class="info-row">
  87. <text class="info-label">单日成本:</text>
  88. <text class="info-value cost">¥{{ item.dayCost || '0' }}</text>
  89. </view>
  90. </view>
  91. <view class="device-actions">
  92. <button class="action-btn view" @click.stop="handleViewDetail(item)">
  93. <uni-icons type="eye" size="14" color="#007AFF"></uni-icons>
  94. <text>查看</text>
  95. </button>
  96. <button class="action-btn edit" @click.stop="handleUpdate(item)" v-if="hasPermission('oa:device:edit')">
  97. <uni-icons type="compose" size="14" color="#FF9500"></uni-icons>
  98. <text>编辑</text>
  99. </button>
  100. <button class="action-btn delete" @click.stop="handleDelete(item)"
  101. v-if="hasPermission('oa:device:remove')">
  102. <uni-icons type="trash" size="14" color="#FF3B30"></uni-icons>
  103. <text>删除</text>
  104. </button>
  105. </view>
  106. </view>
  107. <!-- 加载更多 -->
  108. <view class="loading-more" v-if="hasMore">
  109. <text class="loading-text">加载中...</text>
  110. </view>
  111. <view class="no-more" v-else>
  112. <text class="no-more-text">没有更多数据了</text>
  113. </view>
  114. </template>
  115. <!-- 空状态 -->
  116. <view v-else class="empty-state">
  117. <image src="/static/images/empty.png" mode="aspectFit" class="empty-image"></image>
  118. <text class="empty-text">暂无设备数据</text>
  119. <text class="empty-subtext">点击下方按钮添加设备</text>
  120. </view>
  121. </view>
  122. </scroll-view>
  123. <!-- 悬浮按钮 -->
  124. <view class="fab-button" @click="handleAdd" v-if="hasPermission('oa:device:add')">
  125. <uni-icons type="plusempty" size="24" color="#fff"></uni-icons>
  126. </view>
  127. <!-- 设备详情弹窗 -->
  128. <uni-popup ref="detailPopup" type="center">
  129. <view class="detail-popup">
  130. <view class="popup-header">
  131. <text class="title">设备详情</text>
  132. <uni-icons type="close" size="20" @click="closeDetailPopup"></uni-icons>
  133. </view>
  134. <view class="popup-body">
  135. <view class="detail-item">
  136. <text class="detail-label">设备名称</text>
  137. <text class="detail-value">{{ currentDevice.name }}</text>
  138. </view>
  139. <view class="detail-item">
  140. <text class="detail-label">设备品牌</text>
  141. <text class="detail-value">{{ currentDevice.brand }}</text>
  142. </view>
  143. <view class="detail-item">
  144. <text class="detail-label">设备编号</text>
  145. <text class="detail-value">{{ currentDevice.deviceNumber }}</text>
  146. </view>
  147. <view class="detail-item">
  148. <text class="detail-label">规格型号</text>
  149. <text class="detail-value">{{ currentDevice.series }}</text>
  150. </view>
  151. <view class="detail-item">
  152. <text class="detail-label">出厂编号</text>
  153. <text class="detail-value">{{ currentDevice.code }}</text>
  154. </view>
  155. <view class="detail-item">
  156. <text class="detail-label">设备状态</text>
  157. <text class="detail-value">
  158. <uni-tag :text="statusTypeText(currentDevice.status)" :type="statusTypeStyle(currentDevice.status)"
  159. size="small" />
  160. </text>
  161. </view>
  162. <view class="detail-item">
  163. <text class="detail-label">购置时间</text>
  164. <text class="detail-value">{{ formatDate(currentDevice.acquisitionTime) }}</text>
  165. </view>
  166. <view class="detail-item">
  167. <text class="detail-label">购买价格</text>
  168. <text class="detail-value price">¥{{ currentDevice.cost }}</text>
  169. </view>
  170. <view class="detail-item">
  171. <text class="detail-label">预计使用年限</text>
  172. <text class="detail-value">{{ currentDevice.expectLife }}年</text>
  173. </view>
  174. <view class="detail-item">
  175. <text class="detail-label">单日成本</text>
  176. <text class="detail-value cost">¥{{ currentDevice.dayCost }}</text>
  177. </view>
  178. <view class="detail-item">
  179. <text class="detail-label">存放地点</text>
  180. <text class="detail-value">{{ currentDevice.place || '暂无' }}</text>
  181. </view>
  182. <view class="detail-item">
  183. <text class="detail-label">备注</text>
  184. <text class="detail-value">{{ currentDevice.remark || '暂无' }}</text>
  185. </view>
  186. </view>
  187. <view class="popup-footer">
  188. <button class="popup-btn cancel" @click="closeDetailPopup">关闭</button>
  189. <button class="popup-btn primary" @click="handleViewLogs">查看记录</button>
  190. </view>
  191. </view>
  192. </uni-popup>
  193. <!-- 新增/编辑设备弹窗 -->
  194. <uni-popup ref="formPopup" type="center">
  195. <view class="form-popup">
  196. <view class="popup-header">
  197. <text class="title">{{ isEdit ? '编辑设备' : '新增设备' }}</text>
  198. <uni-icons type="close" size="20" @click="closeFormPopup"></uni-icons>
  199. </view>
  200. <scroll-view scroll-y="true" class="popup-body">
  201. <view class="form-item">
  202. <text class="label">设备品牌 *</text>
  203. <input v-model="form.brand" placeholder="请输入设备品牌" />
  204. </view>
  205. <view class="form-item">
  206. <text class="label">设备名称 *</text>
  207. <input v-model="form.name" placeholder="请输入设备名称" />
  208. </view>
  209. <view class="form-item">
  210. <text class="label">设备类别</text>
  211. <uni-data-select v-model="form.type" :localdata="typeOptions" placeholder="请选择设备类别" />
  212. </view>
  213. <view class="form-item">
  214. <text class="label">规格型号</text>
  215. <input v-model="form.series" placeholder="请输入规格型号" />
  216. </view>
  217. <view class="form-item">
  218. <text class="label">购置时间</text>
  219. <view class="date-picker" @click="openDatePicker">
  220. <text v-if="form.acquisitionTime">{{ form.acquisitionTime }}</text>
  221. <text v-else class="placeholder">请选择购置时间</text>
  222. </view>
  223. </view>
  224. <view class="form-item">
  225. <text class="label">存放地点</text>
  226. <input v-model="form.place" placeholder="请输入存放地点" />
  227. </view>
  228. <view class="form-item">
  229. <text class="label">购买价格(元)</text>
  230. <input v-model="form.cost" type="number" placeholder="请输入购买价格" />
  231. </view>
  232. <view class="form-item">
  233. <text class="label">预计使用年限(年)</text>
  234. <input v-model="form.expectLife" type="number" placeholder="请输入使用年限" />
  235. </view>
  236. <view class="form-item">
  237. <text class="label">出厂编号</text>
  238. <textarea v-model="form.code" placeholder="请输入出厂编号" />
  239. </view>
  240. <view class="form-item">
  241. <text class="label">单日成本(元)</text>
  242. <input v-model="form.dayCost" type="number" placeholder="请输入单日成本" />
  243. </view>
  244. <view class="form-item">
  245. <text class="label">管理部门</text>
  246. <uni-data-select v-model="form.manageDept" :localdata="deptOptions" placeholder="请选择管理部门" />
  247. </view>
  248. <view class="form-item">
  249. <text class="label">设备状态</text>
  250. <uni-data-select v-model="form.status" :localdata="statusOptions" placeholder="请选择设备状态" />
  251. </view>
  252. <view class="form-item">
  253. <text class="label">设备编号</text>
  254. <input v-model="form.deviceNumber" placeholder="请输入设备编号" />
  255. </view>
  256. <view class="form-item">
  257. <text class="label">备注</text>
  258. <textarea v-model="form.remark" placeholder="请输入备注信息" />
  259. </view>
  260. </scroll-view>
  261. <view class="popup-footer">
  262. <button class="popup-btn cancel" @click="closeFormPopup">取消</button>
  263. <button class="popup-btn primary" @click="submitForm">确定</button>
  264. </view>
  265. </view>
  266. </uni-popup>
  267. <!-- 日期选择器 -->
  268. <uv-calendar ref="calendar" mode="single" @confirm="confirmDate"></uv-calendar>
  269. </view>
  270. </template>
  271. <script>
  272. import { listDevice, getDevice, delDevice, addDevice, updateDevice } from "@/api/oa/device/device";
  273. export default {
  274. name: "InstrumentsList",
  275. data() {
  276. return {
  277. // 滚动相关
  278. scrollTop: 0,
  279. isRefreshing: false,
  280. hasMore: true,
  281. // 筛选相关
  282. showFilter: false,
  283. // 列表数据
  284. deviceList: [],
  285. total: 0,
  286. // 查询参数
  287. queryParams: {
  288. pageNum: 1,
  289. pageSize: 20,
  290. name: '',
  291. status: '',
  292. brand: '',
  293. code: '',
  294. series: ''
  295. },
  296. // 表单数据
  297. form: {},
  298. isEdit: false,
  299. // 当前查看的设备
  300. currentDevice: {},
  301. // 选项数据
  302. statusOptions: [
  303. { value: '0', text: '被领用' },
  304. { value: '1', text: '可领用' },
  305. { value: '2', text: '维修中' },
  306. { value: '3', text: '已停用' },
  307. { value: '4', text: '已报废' }
  308. ],
  309. typeOptions: [
  310. { value: '仪器设备', text: '仪器设备' },
  311. { value: '办公设备', text: '办公设备' }
  312. ],
  313. deptOptions: []
  314. };
  315. },
  316. onLoad() {
  317. this.getList();
  318. this.getDeptOptions();
  319. },
  320. methods: {
  321. // 获取设备列表
  322. async getList() {
  323. try {
  324. const response = await listDevice(this.queryParams);
  325. if (this.queryParams.pageNum === 1) {
  326. this.deviceList = response.rows || [];
  327. } else {
  328. this.deviceList = [...this.deviceList, ...(response.rows || [])];
  329. }
  330. this.total = response.total || 0;
  331. this.hasMore = this.deviceList.length < this.total;
  332. } catch (error) {
  333. console.error('获取设备列表失败:', error);
  334. uni.showToast({
  335. title: '获取数据失败',
  336. icon: 'none'
  337. });
  338. }
  339. },
  340. // 获取部门选项
  341. async getDeptOptions() {
  342. try {
  343. // 这里需要根据实际的部门API进行调整
  344. const deptList = this.$store.state.user.deptList || [];
  345. this.deptOptions = deptList.map(dept => ({
  346. value: dept.deptId,
  347. text: dept.deptName
  348. }));
  349. } catch (error) {
  350. console.error('获取部门列表失败:', error);
  351. }
  352. },
  353. // 搜索相关方法
  354. handleSearchInput() {
  355. // 可以在这里添加防抖搜索
  356. },
  357. handleQuery() {
  358. this.queryParams.pageNum = 1;
  359. this.getList();
  360. },
  361. clearSearch() {
  362. this.queryParams.name = '';
  363. this.handleQuery();
  364. },
  365. toggleFilter() {
  366. this.showFilter = !this.showFilter;
  367. },
  368. // 滚动相关方法
  369. upper() {
  370. // 下拉刷新
  371. },
  372. lower() {
  373. if (this.hasMore) {
  374. this.queryParams.pageNum++;
  375. this.getList();
  376. }
  377. },
  378. scroll(e) {
  379. this.scrollTop = e.detail.scrollTop;
  380. },
  381. async onRefresh() {
  382. this.isRefreshing = true;
  383. this.queryParams.pageNum = 1;
  384. await this.getList();
  385. this.isRefreshing = false;
  386. },
  387. // 设备操作方法
  388. handleViewDetail(item) {
  389. this.currentDevice = item;
  390. this.$refs.detailPopup.open();
  391. },
  392. closeDetailPopup() {
  393. this.$refs.detailPopup.close();
  394. },
  395. handleViewLogs() {
  396. this.closeDetailPopup();
  397. },
  398. handleAdd() {
  399. this.isEdit = false;
  400. this.resetForm();
  401. this.$refs.formPopup.open();
  402. },
  403. async handleUpdate(item) {
  404. this.isEdit = true;
  405. try {
  406. const response = await getDevice(item.deviceId);
  407. this.form = response.data || {};
  408. this.$refs.formPopup.open();
  409. } catch (error) {
  410. console.error('获取设备详情失败:', error);
  411. uni.showToast({
  412. title: '获取设备详情失败',
  413. icon: 'none'
  414. });
  415. }
  416. },
  417. closeFormPopup() {
  418. this.$refs.formPopup.close();
  419. },
  420. async handleDelete(item) {
  421. uni.showModal({
  422. title: '确认删除',
  423. content: `是否确认删除设备"${item.name}"?`,
  424. success: async (res) => {
  425. if (res.confirm) {
  426. try {
  427. await delDevice(item.deviceId);
  428. uni.showToast({
  429. title: '删除成功',
  430. icon: 'success'
  431. });
  432. this.getList();
  433. } catch (error) {
  434. console.error('删除设备失败:', error);
  435. uni.showToast({
  436. title: '删除失败',
  437. icon: 'none'
  438. });
  439. }
  440. }
  441. }
  442. });
  443. },
  444. // 表单相关方法
  445. resetForm() {
  446. this.form = {
  447. deviceId: null,
  448. brand: '',
  449. name: '',
  450. type: '仪器设备',
  451. series: '',
  452. acquisitionTime: '',
  453. place: '',
  454. cost: '',
  455. expectLife: '',
  456. code: '',
  457. dayCost: '',
  458. manageDept: '',
  459. status: '1',
  460. deviceNumber: '',
  461. remark: ''
  462. };
  463. },
  464. openDatePicker() {
  465. this.$refs.calendar.open();
  466. },
  467. confirmDate(e) {
  468. this.form.acquisitionTime = e.result;
  469. },
  470. async submitForm() {
  471. // 表单验证
  472. if (!this.form.name) {
  473. uni.showToast({
  474. title: '请输入设备名称',
  475. icon: 'none'
  476. });
  477. return;
  478. }
  479. try {
  480. if (this.isEdit) {
  481. await updateDevice(this.form);
  482. uni.showToast({
  483. title: '修改成功',
  484. icon: 'success'
  485. });
  486. } else {
  487. await addDevice(this.form);
  488. uni.showToast({
  489. title: '新增成功',
  490. icon: 'success'
  491. });
  492. }
  493. this.closeFormPopup();
  494. this.getList();
  495. } catch (error) {
  496. console.error('保存设备失败:', error);
  497. uni.showToast({
  498. title: '保存失败',
  499. icon: 'none'
  500. });
  501. }
  502. },
  503. // 工具方法
  504. formatDate(date) {
  505. if (!date) return '暂无';
  506. return new Date(date).toLocaleDateString();
  507. },
  508. statusTypeText(status) {
  509. const statusMap = {
  510. '0': '被领用',
  511. '1': '可领用',
  512. '2': '维修中',
  513. '3': '已停用',
  514. '4': '已报废'
  515. };
  516. return statusMap[status] || '未知';
  517. },
  518. statusTypeStyle(status) {
  519. const styleMap = {
  520. '0': 'warning',
  521. '1': 'success',
  522. '2': 'primary',
  523. '3': 'error',
  524. '4': 'info'
  525. };
  526. return styleMap[status] || 'default';
  527. },
  528. hasPermission(permission) {
  529. // 这里需要根据实际的权限系统进行调整
  530. return true;
  531. }
  532. }
  533. };
  534. </script>
  535. <style lang="scss" scoped>
  536. .device-container {
  537. height: 100vh;
  538. background-color: #f5f5f5;
  539. display: flex;
  540. flex-direction: column;
  541. }
  542. .search-section {
  543. background: #fff;
  544. padding: 10px 15px;
  545. border-bottom: 1px solid #eee;
  546. }
  547. .search-bar {
  548. margin-bottom: 10px;
  549. }
  550. .search-input-wrapper {
  551. display: flex;
  552. align-items: center;
  553. background: #f8f8f8;
  554. border-radius: 20px;
  555. padding: 8px 15px;
  556. .search-input {
  557. flex: 1;
  558. margin-left: 8px;
  559. font-size: 14px;
  560. }
  561. }
  562. .filter-section {
  563. background: #f8f8f8;
  564. border-radius: 8px;
  565. padding: 10px;
  566. margin-bottom: 10px;
  567. }
  568. .filter-row {
  569. display: flex;
  570. gap: 10px;
  571. margin-bottom: 10px;
  572. &:last-child {
  573. margin-bottom: 0;
  574. }
  575. }
  576. .filter-item {
  577. flex: 1;
  578. .filter-label {
  579. font-size: 12px;
  580. color: #666;
  581. margin-bottom: 5px;
  582. display: block;
  583. }
  584. input {
  585. width: 100%;
  586. padding: 6px 10px;
  587. border: 1px solid #ddd;
  588. border-radius: 4px;
  589. font-size: 12px;
  590. }
  591. }
  592. .filter-toggle {
  593. display: flex;
  594. align-items: center;
  595. justify-content: center;
  596. gap: 5px;
  597. font-size: 14px;
  598. color: #666;
  599. padding: 8px;
  600. }
  601. .device-list {
  602. flex: 1;
  603. }
  604. .content-wrapper {
  605. padding: 15px;
  606. }
  607. .device-card {
  608. background: #fff;
  609. border-radius: 12px;
  610. margin-bottom: 15px;
  611. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  612. overflow: hidden;
  613. }
  614. .device-header {
  615. display: flex;
  616. justify-content: space-between;
  617. align-items: center;
  618. padding: 15px;
  619. border-bottom: 1px solid #f0f0f0;
  620. background: linear-gradient(90deg, #e0e7ff 0%, #f8fafc 100%);
  621. }
  622. .device-info {
  623. flex: 1;
  624. .device-name {
  625. font-size: 16px;
  626. font-weight: 600;
  627. color: #333;
  628. display: block;
  629. margin-bottom: 4px;
  630. }
  631. .device-brand {
  632. font-size: 12px;
  633. color: #666;
  634. }
  635. }
  636. .device-content {
  637. padding: 15px;
  638. }
  639. .info-row {
  640. display: flex;
  641. margin-bottom: 8px;
  642. &:last-child {
  643. margin-bottom: 0;
  644. }
  645. .info-label {
  646. width: 80px;
  647. font-size: 13px;
  648. color: #666;
  649. flex-shrink: 0;
  650. }
  651. .info-value {
  652. flex: 1;
  653. font-size: 13px;
  654. color: #333;
  655. &.price,
  656. &.cost {
  657. color: #ff6b35;
  658. font-weight: 600;
  659. }
  660. }
  661. }
  662. .device-actions {
  663. display: flex;
  664. border-top: 1px solid #f0f0f0;
  665. .action-btn {
  666. flex: 1;
  667. display: flex;
  668. align-items: center;
  669. justify-content: center;
  670. gap: 4px;
  671. padding: 5px;
  672. background: none;
  673. border: none;
  674. font-size: 13px;
  675. &.view {
  676. color: #007AFF;
  677. }
  678. &.edit {
  679. color: #FF9500;
  680. border-left: 1px solid #f0f0f0;
  681. }
  682. &.delete {
  683. color: #FF3B30;
  684. border-left: 1px solid #f0f0f0;
  685. }
  686. }
  687. }
  688. .loading-more,
  689. .no-more {
  690. text-align: center;
  691. padding: 20px;
  692. .loading-text,
  693. .no-more-text {
  694. font-size: 14px;
  695. color: #999;
  696. }
  697. }
  698. .empty-state {
  699. text-align: center;
  700. padding: 60px 20px;
  701. .empty-image {
  702. width: 120px;
  703. height: 120px;
  704. margin-bottom: 20px;
  705. }
  706. .empty-text {
  707. font-size: 16px;
  708. color: #666;
  709. display: block;
  710. margin-bottom: 8px;
  711. }
  712. .empty-subtext {
  713. font-size: 14px;
  714. color: #999;
  715. }
  716. }
  717. .fab-button {
  718. position: fixed;
  719. right: 20px;
  720. bottom: 30px;
  721. width: 56px;
  722. height: 56px;
  723. background: #6366f1;
  724. border-radius: 50%;
  725. display: flex;
  726. align-items: center;
  727. justify-content: center;
  728. box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  729. z-index: 999;
  730. }
  731. // 弹窗样式
  732. .detail-popup,
  733. .form-popup {
  734. background: #fff;
  735. border-radius: 12px;
  736. width: 90vw;
  737. max-height: 80vh;
  738. display: flex;
  739. flex-direction: column;
  740. }
  741. .popup-header {
  742. display: flex;
  743. justify-content: space-between;
  744. align-items: center;
  745. padding: 20px;
  746. border-bottom: 1px solid #f0f0f0;
  747. .title {
  748. font-size: 18px;
  749. font-weight: 600;
  750. color: #333;
  751. }
  752. }
  753. .popup-body {
  754. flex: 1;
  755. padding: 20px;
  756. max-height: 60vh;
  757. }
  758. .detail-item {
  759. display: flex;
  760. margin-bottom: 15px;
  761. .detail-label {
  762. width: 80px;
  763. font-size: 14px;
  764. color: #666;
  765. flex-shrink: 0;
  766. }
  767. .detail-value {
  768. flex: 1;
  769. font-size: 14px;
  770. color: #333;
  771. &.price,
  772. &.cost {
  773. color: #ff6b35;
  774. font-weight: 600;
  775. }
  776. }
  777. }
  778. .form-item {
  779. margin-bottom: 20px;
  780. .label {
  781. font-size: 14px;
  782. color: #333;
  783. margin-bottom: 8px;
  784. display: block;
  785. }
  786. input,
  787. textarea {
  788. width: 100%;
  789. padding: 12px;
  790. border: 1px solid #ddd;
  791. border-radius: 8px;
  792. font-size: 14px;
  793. background: #f8f8f8;
  794. &:focus {
  795. border-color: #667eea;
  796. background: #fff;
  797. }
  798. }
  799. textarea {
  800. min-height: 80px;
  801. resize: none;
  802. }
  803. .date-picker {
  804. padding: 12px;
  805. border: 1px solid #ddd;
  806. border-radius: 8px;
  807. background: #f8f8f8;
  808. font-size: 14px;
  809. .placeholder {
  810. color: #999;
  811. }
  812. }
  813. }
  814. .popup-footer {
  815. display: flex;
  816. gap: 15px;
  817. padding: 10px;
  818. border-top: 1px solid #f0f0f0;
  819. .popup-btn {
  820. flex: 1;
  821. padding: 1px;
  822. border-radius: 8px;
  823. font-size: 16px;
  824. border: none;
  825. &.cancel {
  826. background: #f5f5f5;
  827. color: #666;
  828. }
  829. &.primary {
  830. background: #6366f1;
  831. color: #fff;
  832. }
  833. }
  834. }
  835. </style>