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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940
  1. <!--
  2. * @Author: ysh
  3. * @Date: 2025-07-08 14:00:47
  4. * @LastEditors: Please set LastEditors
  5. * @LastEditTime: 2025-07-08 15:50:20
  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. uni.navigateTo({
  398. url: `/pages/oa/device/deviceLog?deviceId=${this.currentDevice.deviceId}`
  399. });
  400. },
  401. handleAdd() {
  402. this.isEdit = false;
  403. this.resetForm();
  404. this.$refs.formPopup.open();
  405. },
  406. async handleUpdate(item) {
  407. this.isEdit = true;
  408. try {
  409. const response = await getDevice(item.deviceId);
  410. this.form = response.data || {};
  411. this.$refs.formPopup.open();
  412. } catch (error) {
  413. console.error('获取设备详情失败:', error);
  414. uni.showToast({
  415. title: '获取设备详情失败',
  416. icon: 'none'
  417. });
  418. }
  419. },
  420. closeFormPopup() {
  421. this.$refs.formPopup.close();
  422. },
  423. async handleDelete(item) {
  424. uni.showModal({
  425. title: '确认删除',
  426. content: `是否确认删除设备"${item.name}"?`,
  427. success: async (res) => {
  428. if (res.confirm) {
  429. try {
  430. await delDevice(item.deviceId);
  431. uni.showToast({
  432. title: '删除成功',
  433. icon: 'success'
  434. });
  435. this.getList();
  436. } catch (error) {
  437. console.error('删除设备失败:', error);
  438. uni.showToast({
  439. title: '删除失败',
  440. icon: 'none'
  441. });
  442. }
  443. }
  444. }
  445. });
  446. },
  447. // 表单相关方法
  448. resetForm() {
  449. this.form = {
  450. deviceId: null,
  451. brand: '',
  452. name: '',
  453. type: '仪器设备',
  454. series: '',
  455. acquisitionTime: '',
  456. place: '',
  457. cost: '',
  458. expectLife: '',
  459. code: '',
  460. dayCost: '',
  461. manageDept: '',
  462. status: '1',
  463. deviceNumber: '',
  464. remark: ''
  465. };
  466. },
  467. openDatePicker() {
  468. this.$refs.calendar.open();
  469. },
  470. confirmDate(e) {
  471. this.form.acquisitionTime = e.result;
  472. },
  473. async submitForm() {
  474. // 表单验证
  475. if (!this.form.name) {
  476. uni.showToast({
  477. title: '请输入设备名称',
  478. icon: 'none'
  479. });
  480. return;
  481. }
  482. try {
  483. if (this.isEdit) {
  484. await updateDevice(this.form);
  485. uni.showToast({
  486. title: '修改成功',
  487. icon: 'success'
  488. });
  489. } else {
  490. await addDevice(this.form);
  491. uni.showToast({
  492. title: '新增成功',
  493. icon: 'success'
  494. });
  495. }
  496. this.closeFormPopup();
  497. this.getList();
  498. } catch (error) {
  499. console.error('保存设备失败:', error);
  500. uni.showToast({
  501. title: '保存失败',
  502. icon: 'none'
  503. });
  504. }
  505. },
  506. // 工具方法
  507. formatDate(date) {
  508. if (!date) return '暂无';
  509. return new Date(date).toLocaleDateString();
  510. },
  511. statusTypeText(status) {
  512. const statusMap = {
  513. '0': '被领用',
  514. '1': '可领用',
  515. '2': '维修中',
  516. '3': '已停用',
  517. '4': '已报废'
  518. };
  519. return statusMap[status] || '未知';
  520. },
  521. statusTypeStyle(status) {
  522. const styleMap = {
  523. '0': 'warning',
  524. '1': 'success',
  525. '2': 'primary',
  526. '3': 'error',
  527. '4': 'info'
  528. };
  529. return styleMap[status] || 'default';
  530. },
  531. hasPermission(permission) {
  532. // 这里需要根据实际的权限系统进行调整
  533. return true;
  534. }
  535. }
  536. };
  537. </script>
  538. <style lang="scss" scoped>
  539. .device-container {
  540. height: 100vh;
  541. background-color: #f5f5f5;
  542. display: flex;
  543. flex-direction: column;
  544. }
  545. .search-section {
  546. background: #fff;
  547. padding: 10px 15px;
  548. border-bottom: 1px solid #eee;
  549. }
  550. .search-bar {
  551. margin-bottom: 10px;
  552. }
  553. .search-input-wrapper {
  554. display: flex;
  555. align-items: center;
  556. background: #f8f8f8;
  557. border-radius: 20px;
  558. padding: 8px 15px;
  559. .search-input {
  560. flex: 1;
  561. margin-left: 8px;
  562. font-size: 14px;
  563. }
  564. }
  565. .filter-section {
  566. background: #f8f8f8;
  567. border-radius: 8px;
  568. padding: 10px;
  569. margin-bottom: 10px;
  570. }
  571. .filter-row {
  572. display: flex;
  573. gap: 10px;
  574. margin-bottom: 10px;
  575. &:last-child {
  576. margin-bottom: 0;
  577. }
  578. }
  579. .filter-item {
  580. flex: 1;
  581. .filter-label {
  582. font-size: 12px;
  583. color: #666;
  584. margin-bottom: 5px;
  585. display: block;
  586. }
  587. input {
  588. width: 100%;
  589. padding: 6px 10px;
  590. border: 1px solid #ddd;
  591. border-radius: 4px;
  592. font-size: 12px;
  593. }
  594. }
  595. .filter-toggle {
  596. display: flex;
  597. align-items: center;
  598. justify-content: center;
  599. gap: 5px;
  600. font-size: 14px;
  601. color: #666;
  602. padding: 8px;
  603. }
  604. .device-list {
  605. flex: 1;
  606. }
  607. .content-wrapper {
  608. padding: 15px;
  609. }
  610. .device-card {
  611. background: #fff;
  612. border-radius: 12px;
  613. margin-bottom: 15px;
  614. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  615. overflow: hidden;
  616. }
  617. .device-header {
  618. display: flex;
  619. justify-content: space-between;
  620. align-items: center;
  621. padding: 15px;
  622. border-bottom: 1px solid #f0f0f0;
  623. }
  624. .device-info {
  625. flex: 1;
  626. .device-name {
  627. font-size: 16px;
  628. font-weight: 600;
  629. color: #333;
  630. display: block;
  631. margin-bottom: 4px;
  632. }
  633. .device-brand {
  634. font-size: 12px;
  635. color: #666;
  636. }
  637. }
  638. .device-content {
  639. padding: 15px;
  640. }
  641. .info-row {
  642. display: flex;
  643. margin-bottom: 8px;
  644. &:last-child {
  645. margin-bottom: 0;
  646. }
  647. .info-label {
  648. width: 80px;
  649. font-size: 13px;
  650. color: #666;
  651. flex-shrink: 0;
  652. }
  653. .info-value {
  654. flex: 1;
  655. font-size: 13px;
  656. color: #333;
  657. &.price,
  658. &.cost {
  659. color: #ff6b35;
  660. font-weight: 600;
  661. }
  662. }
  663. }
  664. .device-actions {
  665. display: flex;
  666. border-top: 1px solid #f0f0f0;
  667. .action-btn {
  668. flex: 1;
  669. display: flex;
  670. align-items: center;
  671. justify-content: center;
  672. gap: 4px;
  673. padding: 12px;
  674. background: none;
  675. border: none;
  676. font-size: 13px;
  677. &.view {
  678. color: #007AFF;
  679. }
  680. &.edit {
  681. color: #FF9500;
  682. border-left: 1px solid #f0f0f0;
  683. }
  684. &.delete {
  685. color: #FF3B30;
  686. border-left: 1px solid #f0f0f0;
  687. }
  688. }
  689. }
  690. .loading-more,
  691. .no-more {
  692. text-align: center;
  693. padding: 20px;
  694. .loading-text,
  695. .no-more-text {
  696. font-size: 14px;
  697. color: #999;
  698. }
  699. }
  700. .empty-state {
  701. text-align: center;
  702. padding: 60px 20px;
  703. .empty-image {
  704. width: 120px;
  705. height: 120px;
  706. margin-bottom: 20px;
  707. }
  708. .empty-text {
  709. font-size: 16px;
  710. color: #666;
  711. display: block;
  712. margin-bottom: 8px;
  713. }
  714. .empty-subtext {
  715. font-size: 14px;
  716. color: #999;
  717. }
  718. }
  719. .fab-button {
  720. position: fixed;
  721. right: 20px;
  722. bottom: 30px;
  723. width: 56px;
  724. height: 56px;
  725. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  726. border-radius: 50%;
  727. display: flex;
  728. align-items: center;
  729. justify-content: center;
  730. box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  731. z-index: 999;
  732. }
  733. // 弹窗样式
  734. .detail-popup,
  735. .form-popup {
  736. background: #fff;
  737. border-radius: 12px;
  738. width: 90vw;
  739. max-height: 80vh;
  740. display: flex;
  741. flex-direction: column;
  742. }
  743. .popup-header {
  744. display: flex;
  745. justify-content: space-between;
  746. align-items: center;
  747. padding: 20px;
  748. border-bottom: 1px solid #f0f0f0;
  749. .title {
  750. font-size: 18px;
  751. font-weight: 600;
  752. color: #333;
  753. }
  754. }
  755. .popup-body {
  756. flex: 1;
  757. padding: 20px;
  758. max-height: 60vh;
  759. }
  760. .detail-item {
  761. display: flex;
  762. margin-bottom: 15px;
  763. .detail-label {
  764. width: 80px;
  765. font-size: 14px;
  766. color: #666;
  767. flex-shrink: 0;
  768. }
  769. .detail-value {
  770. flex: 1;
  771. font-size: 14px;
  772. color: #333;
  773. &.price,
  774. &.cost {
  775. color: #ff6b35;
  776. font-weight: 600;
  777. }
  778. }
  779. }
  780. .form-item {
  781. margin-bottom: 20px;
  782. .label {
  783. font-size: 14px;
  784. color: #333;
  785. margin-bottom: 8px;
  786. display: block;
  787. }
  788. input,
  789. textarea {
  790. width: 100%;
  791. padding: 12px;
  792. border: 1px solid #ddd;
  793. border-radius: 8px;
  794. font-size: 14px;
  795. background: #f8f8f8;
  796. &:focus {
  797. border-color: #667eea;
  798. background: #fff;
  799. }
  800. }
  801. textarea {
  802. min-height: 80px;
  803. resize: none;
  804. }
  805. .date-picker {
  806. padding: 12px;
  807. border: 1px solid #ddd;
  808. border-radius: 8px;
  809. background: #f8f8f8;
  810. font-size: 14px;
  811. .placeholder {
  812. color: #999;
  813. }
  814. }
  815. }
  816. .popup-footer {
  817. display: flex;
  818. gap: 15px;
  819. padding: 20px;
  820. border-top: 1px solid #f0f0f0;
  821. .popup-btn {
  822. flex: 1;
  823. padding: 12px;
  824. border-radius: 8px;
  825. font-size: 16px;
  826. border: none;
  827. &.cancel {
  828. background: #f5f5f5;
  829. color: #666;
  830. }
  831. &.primary {
  832. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  833. color: #fff;
  834. }
  835. }
  836. }
  837. </style>