| | |
| | | }); |
| | | }, |
| | | globalData: { |
| | | // é坿¶å¾
åäºé¡¹ |
| | | onLaunch:[], |
| | | userInfo: { |
| | | district: undefined, |
| | | }, |
| | |
| | | |
| | | function loadConfig() { |
| | | const pList = []; |
| | | |
| | | const userId = app.globalData.accessToken.userId; |
| | | const f1 = fetchSceneTypes({ userId }).then(res => { |
| | | wx.setStorage({ |
| | |
| | | const app = getApp(); |
| | | // è·åç¨æ·é
ç½®ä¿¡æ¯ |
| | | const userConfig = app.globalData.userConfig; |
| | | // åæ¢è´¦å·æ¶,éç½®å¯éè¡æ¿åºå |
| | | app.globalData.onLaunch.push(() => { |
| | | remoteLocations = []; |
| | | }); |
| | | |
| | | const _locations = [ |
| | | { |
| | |
| | | |
| | | function locations() { |
| | | if (remoteLocations.length > 0) return remoteLocations; |
| | | // è·åç¨æ·é
ç½®ä¿¡æ¯ |
| | | const userConfig = app.globalData.userConfig; |
| | | if (!userConfig) { |
| | | remoteLocations = _locations; |
| | | return remoteLocations; |
| | |
| | | * 设å¤è¿ç»´é¢æ¬¡ |
| | | */ |
| | | const freq = [ |
| | | { value: '0', label: 'æ¯å¨ä¸æ¬¡' }, |
| | | // { value: '0', label: 'æ¯å¨ä¸æ¬¡' }, |
| | | { value: '1', label: 'æ¯æä¸æ¬¡' }, |
| | | { value: '2', label: 'æ¯å£åº¦ä¸æ¬¡' }, |
| | | { value: '3', label: 'æ¯å年䏿¬¡' }, |
| | |
| | | <view class="filter-item" bind:tap="handleSort"> |
| | | <text style="color: {{sorts !== '' ? color : '' }}">è¯å</text> |
| | | <view class="filter-sort"> |
| | | <!-- <t-icon |
| | | <t-icon |
| | | prefix="wr" |
| | | name="arrow_drop_up" |
| | | size="18rpx" |
| | | style="color:{{sorts === 'asc' ? color : '#bbb'}}" |
| | | /> --> |
| | | <t-icon |
| | | /> |
| | | <!-- <t-icon |
| | | name="component-grid" |
| | | size="18rpx" |
| | | style="color:{{sorts === 'asc' ? color : '#bbb'}}" |
| | | /> |
| | | /> --> |
| | | <t-icon |
| | | prefix="wr" |
| | | name="arrow_drop_down" |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { useLoading } from '../../../behaviors/loading'; |
| | | |
| | | Component({ |
| | | behaviors: [useLoading], |
| | | options: { |
| | | multipleSlots: true, // å¨ç»ä»¶å®ä¹æ¶çé项ä¸å¯ç¨å¤slotæ¯æ |
| | | }, |
| | | properties: { |
| | | placeholder: 'è¾å
¥å
³é®è¯æç´¢', |
| | | // æç´¢ç¼ååå²è®°å½å卿 ç¾ |
| | | historyTag: 'historyWords', |
| | | // æç´¢ç»æ |
| | | searchResult: [], |
| | | }, |
| | | data: { |
| | | searchValue: '', |
| | | isSearch: false, |
| | | historyWords: [], |
| | | dialog: { |
| | | title: '确认å é¤å½ååå²è®°å½', |
| | | showCancelButton: true, |
| | | message: '', |
| | | }, |
| | | dialogShow: false, |
| | | deleteType: 0, |
| | | deleteIndex: '', |
| | | }, |
| | | lifetimes: { |
| | | attached: function () { |
| | | // å¨ç»ä»¶å®ä¾è¿å
¥é¡µé¢èç¹æ æ¶æ§è¡ |
| | | let optionList = optionListFunc; |
| | | if (typeof optionListFunc === 'function') { |
| | | optionList = optionListFunc(); |
| | | } |
| | | this.setSelectOptions(keyword, optionList); |
| | | this.onInitialValue(keyword); |
| | | }, |
| | | }, |
| | | methods: {}, |
| | | }); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "component": true, |
| | | "usingComponents": {} |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <view class="page"> |
| | | <view class="page-header"> |
| | | <t-search |
| | | placeholder="{{placeholder}}" |
| | | model:value="{{searchValue}}" |
| | | bind:submit="handleSubmit" |
| | | bind:clear="handleClear" |
| | | bind:change="handleChange" |
| | | focus |
| | | > |
| | | </t-search> |
| | | </view> |
| | | |
| | | <view class="page-container"> |
| | | <enterprise-search-result |
| | | wx:for="{{searchResult}}" |
| | | wx:key="index" |
| | | wx:for-index="index" |
| | | result="{{item}}" |
| | | bind:click="handCellClick" |
| | | ></enterprise-search-result> |
| | | <load-more |
| | | list-is-empty="{{!searchResult.length}}" |
| | | status="{{loadStatus}}" |
| | | bind:retry="_startLoad" |
| | | /> |
| | | <t-empty |
| | | wx:if="{{loadStatus == 2 && isSearch && searchResult.length == 0}}" |
| | | icon="info-circle-filled" |
| | | description="æ å¹é
è®°å½" |
| | | /> |
| | | <block wx:if="{{!isSearch}}"> |
| | | <view wx:if="{{historyWords.length > 0}}" class="history-wrap"> |
| | | <view class="search-header"> |
| | | <text class="search-title">åå²æç´¢</text> |
| | | <text class="search-clear" bind:tap="handleClearHistory">æ¸
é¤</text> |
| | | </view> |
| | | <view class="search-content"> |
| | | <view |
| | | class="search-item" |
| | | hover-class="hover-history-item" |
| | | wx:for="{{historyWords}}" |
| | | bind:tap="handleHistoryTap" |
| | | bindlongpress="deleteCurr" |
| | | data-index="{{index}}" |
| | | wx:key="index" |
| | | > |
| | | {{item}} |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <t-empty |
| | | wx:else |
| | | t-class-image="t-empty__image" |
| | | image="/res/nodata.png" |
| | | description="请æç´¢" |
| | | /> |
| | | </block> |
| | | </view> |
| | | <view class="page-footer"></view> |
| | | <t-dialog |
| | | visible="{{dialogShow}}" |
| | | content="{{dialog.message}}" |
| | | bindconfirm="confirm" |
| | | bind:close="close" |
| | | confirm-btn="ç¡®å®" |
| | | cancel-btn="{{dialog.showCancelButton ? 'åæ¶' : null}}" |
| | | t-class-confirm="add-notes__confirm" |
| | | /> |
| | | </view> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* components/search/index.wxss */ |
| | |
| | | const baseFileUrl = `${bu}/meeting/file/`; |
| | | |
| | | // 线ä¸ç管 |
| | | // const inspectUrl = 'https://fyami.com.cn:447'; |
| | | const inspectUrl = 'https://fyami.com.cn:447'; |
| | | // const inspectUrl = 'http://192.168.0.138:8082'; |
| | | const inspectUrl = 'http://192.168.1.8:8080'; |
| | | // const inspectUrl = 'http://192.168.0.138:8080'; |
| | | // const inspectUrl = 'http://192.168.1.8:8080'; |
| | | |
| | | const iu = 'https://fyami.com.cn:447'; |
| | | const inspectPicUrl = `${iu}/images/`; |
| | | // const inspectPicUrl = `${inspectUrl}/images/`; |
| | | |
| | | const mode = 'debug'; |
| | | // const mode = 'prod'; |
| | | // const mode = 'debug'; |
| | | const mode = 'prod'; |
| | | |
| | | export { basePicUrl, baseUrl, baseFileUrl, baseIconUrl, inspectUrl, inspectPicUrl, mode }; |
| | |
| | | import { baseIconUrl } from "../config/index"; |
| | | |
| | | export default [ |
| | | { |
| | | icon: 'home', |
| | | text: 'é¦é¡µ', |
| | | url: 'pages/home/index', |
| | | level: 2, |
| | | }, |
| | | { |
| | | icon: 'app', |
| | | text: 'ç²¾ç»åç管', |
| | | url: 'pages/supervision/index', |
| | | level: 2, |
| | | }, |
| | | { |
| | | // icon: `${baseIconUrl}tab-slef-patrol.png`, |
| | | icon: 'root-list', |
| | | text: 'åºæ¥èªå·¡æ¥', |
| | | url: 'pages/selfpatrol/index', |
| | | // url: '', |
| | | level: 2, |
| | | }, |
| | | // { |
| | | // icon: 'system-device', |
| | | // text: '设å¤ç®¡ç', |
| | | // url: 'pages/inspection/scene/index', |
| | | // level: 1, |
| | | // }, |
| | | { |
| | | icon: 'user', |
| | | text: '个人ä¸å¿', |
| | | url: 'pages/usercenter/index', |
| | | // url: '', |
| | | level: 2, |
| | | }, |
| | | ]; |
| | |
| | | import TabMenu from './data'; |
| | | const app = getApp(); |
| | | |
| | | Component({ |
| | | data: { |
| | | active: 0, |
| | | list: TabMenu, |
| | | }, |
| | | |
| | | attached() { |
| | | const menu = TabMenu.map(v => { |
| | | v.visible = app.globalData.userInfo.usertypeid <= v.level; |
| | | return v; |
| | | }); |
| | | this.setData({ list: menu }); |
| | | }, |
| | | methods: { |
| | | onChange(event) { |
| | | let index = event.detail.value; |
| | |
| | | const page = getCurrentPages().pop(); |
| | | const route = page ? page.route.split('?')[0] : ''; |
| | | const active = this.data.list.findIndex( |
| | | item => |
| | | (item.url.startsWith('/') ? item.url.substr(1) : item.url) === |
| | | `${route}`, |
| | | item => (item.url.startsWith('/') ? item.url.substr(1) : item.url) === `${route}`, |
| | | ); |
| | | this.setData({ active }); |
| | | }, |
| | |
| | | <view class="custom-tab-bar"> |
| | | <t-tab-bar |
| | | value="{{active}}" |
| | | bindchange="onChange" |
| | | split="{{false}}" |
| | | shape="normal" |
| | | > |
| | | <t-tab-bar-item |
| | | wx:for="{{list}}" |
| | | wx:for-item="item" |
| | | wx:for-index="index" |
| | | wx:key="index" |
| | | icon="{{item.icon}}" |
| | | > |
| | | <t-tab-bar value="{{active}}" bindchange="onChange" split="{{false}}" shape="normal"> |
| | | <block wx:for="{{list}}" wx:for-item="item" wx:for-index="index" wx:key="index"> |
| | | <t-tab-bar-item class="{{item.visible ? '' : 'hidden'}}" icon="{{item.icon}}"> |
| | | {{ item.text }} |
| | | </t-tab-bar-item> |
| | | </block> |
| | | </t-tab-bar> |
| | | </view> |
| | |
| | | --td-tab-bar-color: rgb(163, 163, 163); |
| | | /* --td-tab-bar-active-color: #333; */ |
| | | } |
| | | |
| | | .hidden{ |
| | | /* display: none; */ |
| | | } |
| | |
| | | |
| | | name | type | default | description | required |
| | | -- | -- | -- | -- | -- |
| | | close-btn | Boolean / Slot | true | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N |
| | | keys | Object | - | Typescriptï¼`KeysType`ã[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N |
| | | close-btn | Boolean / Slot | true | \- | N |
| | | keys | Object | - | Typescriptï¼`KeysType` | N |
| | | options | Array | [] | Typescriptï¼`Array<CascaderOption>` | N |
| | | placeholder | String | éæ©é项 | \- | N |
| | | sub-titles | Array | [] | Typescriptï¼`Array<string>` | N |
| | | theme | String | step | options: step/tab | N |
| | | title | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N |
| | | theme | String | step | optionsï¼step/tab | N |
| | | title | String / Slot | - | \- | N |
| | | value | String / Number | null | \- | N |
| | | default-value | String / Number | undefined | uncontrolled property | N |
| | | visible | Boolean | false | \- | N |
| | |
| | | change | `(value: string \| number, selectedOptions: string[])` | `1.0.1` |
| | | close | `(trigger: TriggerSource)` | `1.0.1`ã[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/cascader/type.ts)ã<br/>`type TriggerSource = 'overlay' \| 'close-btn' \| 'finish'`<br/> |
| | | pick | `(value: string \| number, index: number)` | `1.0.1` |
| | | |
| | | |
| | | ### CSS Variables |
| | | The component provides the following CSS variables, which can be used to customize styles. |
| | | Name | Default Value | Description |
| | | -- | -- | -- |
| | | --td-cascader-active-color | @brand-color | - |
| | | --td-cascader-bg-color | @bg-color-container | - |
| | | --td-cascader-border-color | @component-stroke | - |
| | | --td-cascader-content-height | 78vh | - |
| | | --td-cascader-disabled-color | @text-color-disabled | - |
| | | --td-cascader-options-height | calc(100% - @cascader-step-height) | - |
| | | --td-cascader-options-title-color | @text-color-placeholder | - |
| | | --td-cascader-step-arrow-color | @text-color-placeholder | - |
| | | --td-cascader-step-dot-size | 16rpx | - |
| | | --td-cascader-step-height | 88rpx | - |
| | | --td-cascader-title-color | @text-color-primary | - |
| | | --td-cascader-title-height | 26rpx | - |
| | | --td-cascader-title-padding | @spacer-2 | - |
| | | --td-cascder-title-font-size | 36rpx | - |
| | |
| | | |
| | | ## ä»£ç æ¼ç¤º |
| | | |
| | | <a href="https://developers.weixin.qq.com/s/i75I6imI7TSh" title="å¨å¼åè
å·¥å
·ä¸é¢è§ææ" target="_blank" rel="noopener noreferrer"> å¨å¼åè
å·¥å
·ä¸é¢è§ææ </a> |
| | | |
| | | <blockquote style="background-color: #d9e1ff; font-size: 15px; line-height: 26px;margin: 16px 0 0;padding: 16px; border-radius: 6px; color: #0052d9" > |
| | | <p>Tips: 请确ä¿å¼åè
å·¥å
·ä¸ºæå¼ç¶æã导å
¥å¼åè
å·¥å
·åï¼ä¾æ¬¡æ§è¡ï¼npm i > æå»ºnpmå
> å¾é "å°JSç¼è¯æES5"</p> |
| | | </blockquote> |
| | | |
| | | ### åºç¡ç¨æ³ |
| | | |
| | | {{ base }} |
| | |
| | | |
| | | åç§° | ç±»å | é»è®¤å¼ | 说æ | å¿
ä¼ |
| | | -- | -- | -- | -- | -- |
| | | close-btn | Boolean / Slot | true | å
³éæé®ã[éç¨ç±»åå®ä¹](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N |
| | | keys | Object | - | ç¨æ¥å®ä¹ value / label å¨ `options` ä¸å¯¹åºçåæ®µå«åãTS ç±»åï¼`KeysType`ã[éç¨ç±»åå®ä¹](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N |
| | | close-btn | Boolean / Slot | true | å
³éæé® | N |
| | | keys | Object | - | ç¨æ¥å®ä¹ value / label å¨ `options` ä¸å¯¹åºçåæ®µå«åãTS ç±»åï¼`KeysType` | N |
| | | options | Array | [] | å¯éé¡¹æ°æ®æºãTS ç±»åï¼`Array<CascaderOption>` | N |
| | | placeholder | String | éæ©é项 | æªé䏿¶çæç¤ºææ¡ | N |
| | | sub-titles | Array | [] | æ¯çº§å±ç¤ºç次æ é¢ãTS ç±»åï¼`Array<string>` | N |
| | | theme | String | step | å±ç¤ºé£æ ¼ãå¯é项ï¼step/tab | N |
| | | title | String / Slot | - | æ é¢ã[éç¨ç±»åå®ä¹](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N |
| | | title | String / Slot | - | æ é¢ | N |
| | | value | String / Number | null | éé¡¹å¼ | N |
| | | default-value | String / Number | undefined | é项å¼ãé忧屿§ | N |
| | | visible | Boolean | false | æ¯å¦å±ç¤º | N |
| | |
| | | change | `(value: string \| number, selectedOptions: string[])` | `1.0.1`ãå¼åçåæ´æ¶è§¦å |
| | | close | `(trigger: TriggerSource)` | `1.0.1`ãå
³éæ¶è§¦åã[详ç»ç±»åå®ä¹](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/cascader/type.ts)ã<br/>`type TriggerSource = 'overlay' \| 'close-btn' \| 'finish'`<br/> |
| | | pick | `(value: string \| number, index: number)` | `1.0.1`ãéæ©å触å |
| | | |
| | | |
| | | ### CSS Variables |
| | | ç»ä»¶æä¾äºä¸å CSS åéï¼å¯ç¨äºèªå®ä¹æ ·å¼ã |
| | | åç§° | é»è®¤å¼ | æè¿° |
| | | -- | -- | -- |
| | | --td-cascader-active-color | @brand-color | - |
| | | --td-cascader-bg-color | @bg-color-container | - |
| | | --td-cascader-border-color | @component-stroke | - |
| | | --td-cascader-content-height | 78vh | - |
| | | --td-cascader-disabled-color | @text-color-disabled | - |
| | | --td-cascader-options-height | calc(100% - @cascader-step-height) | - |
| | | --td-cascader-options-title-color | @text-color-placeholder | - |
| | | --td-cascader-step-arrow-color | @text-color-placeholder | - |
| | | --td-cascader-step-dot-size | 16rpx | - |
| | | --td-cascader-step-height | 88rpx | - |
| | | --td-cascader-title-color | @text-color-primary | - |
| | | --td-cascader-title-height | 26rpx | - |
| | | --td-cascader-title-padding | @spacer-2 | - |
| | | --td-cascder-title-font-size | 36rpx | - |
| | |
| | | export default class Cascader extends SuperComponent { |
| | | externalClasses: string[]; |
| | | options: WechatMiniprogram.Component.ComponentOptions; |
| | | properties: TdCascaderProps<import("../common/common").TreeOptionData<string | number>>; |
| | | properties: TdCascaderProps<import("../common/common").TreeOptionData>; |
| | | controlledProps: { |
| | | key: string; |
| | | event: string; |
| | | }[]; |
| | | state: { |
| | | contentHeight: number; |
| | | stepHeight: number; |
| | | tabsHeight: number; |
| | | subTitlesHeight: number; |
| | | stepsInitHeight: number; |
| | | }; |
| | | data: { |
| | | prefix: string; |
| | | name: string; |
| | | stepIndex: number; |
| | | selectedIndexes: any[]; |
| | | selectedValue: any[]; |
| | | defaultOptionLabel: string; |
| | | scrollTopList: any[]; |
| | | steps: any[]; |
| | | _optionsHeight: number; |
| | | steps: string[]; |
| | | }; |
| | | observers: { |
| | | visible(v: any): void; |
| | | value(): void; |
| | | options(): void; |
| | | selectedIndexes(): void; |
| | | 'selectedIndexes, options'(): void; |
| | | stepIndex(): Promise<void>; |
| | | }; |
| | | methods: { |
| | | updateOptionsHeight(steps: number): void; |
| | | initOptionsHeight(steps: number): Promise<void>; |
| | | initWithValue(): void; |
| | | getIndexesByValue(options: import("../common/common").TreeOptionData<string | number>[], value: any): any[]; |
| | | getIndexesByValue(options: import("../common/common").TreeOptionData[], value: any): any[]; |
| | | updateScrollTop(): void; |
| | | hide(trigger: any): void; |
| | | onVisibleChange(): void; |
| | | onClose(): void; |
| | | onStepClick(e: any): void; |
| | | onTabChange(e: any): void; |
| | | genItems(): { |
| | | selectedValue: any[]; |
| | | steps: any[]; |
| | | items: { |
| | | [x: string]: any; |
| | | }[][]; |
| | | }; |
| | | handleSelect(e: any): void; |
| | | }; |
| | | } |
| | |
| | | import { getRect } from '../common/utils'; |
| | | const { prefix } = config; |
| | | const name = `${prefix}-cascader`; |
| | | function parseOptions(options, keys) { |
| | | var _a, _b; |
| | | const label = (_a = keys === null || keys === void 0 ? void 0 : keys.label) !== null && _a !== void 0 ? _a : 'label'; |
| | | const value = (_b = keys === null || keys === void 0 ? void 0 : keys.value) !== null && _b !== void 0 ? _b : 'value'; |
| | | return options.map((item) => { |
| | | return { |
| | | [label]: item[label], |
| | | [value]: item[value], |
| | | }; |
| | | }); |
| | | } |
| | | const defaultState = { |
| | | contentHeight: 0, |
| | | stepHeight: 0, |
| | | tabsHeight: 0, |
| | | subTitlesHeight: 0, |
| | | stepsInitHeight: 0, |
| | | }; |
| | | const defaultOptionLabel = 'éæ©é项'; |
| | | let Cascader = class Cascader extends SuperComponent { |
| | | constructor() { |
| | | super(...arguments); |
| | | this.externalClasses = [`${prefix}-class`]; |
| | | this.options = { |
| | | multipleSlots: true, |
| | | pureDataPattern: /^options$/, |
| | | }; |
| | | this.properties = props; |
| | | this.controlledProps = [ |
| | |
| | | event: 'change', |
| | | }, |
| | | ]; |
| | | this.state = Object.assign({}, defaultState); |
| | | this.data = { |
| | | prefix, |
| | | name, |
| | | stepIndex: 0, |
| | | selectedIndexes: [], |
| | | selectedValue: [], |
| | | defaultOptionLabel, |
| | | scrollTopList: [], |
| | | steps: [], |
| | | _optionsHeight: 0, |
| | | steps: [defaultOptionLabel], |
| | | }; |
| | | this.observers = { |
| | | visible(v) { |
| | | if (v) { |
| | | const $tabs = this.selectComponent('#tabs'); |
| | | $tabs === null || $tabs === void 0 ? void 0 : $tabs.setTrack(); |
| | | $tabs === null || $tabs === void 0 ? void 0 : $tabs.getTabHeight().then((res) => { |
| | | this.state.tabsHeight = res.height; |
| | | }); |
| | | this.initOptionsHeight(this.data.steps.length); |
| | | this.updateScrollTop(); |
| | | this.initWithValue(); |
| | | } |
| | | else { |
| | | this.state = Object.assign({}, defaultState); |
| | | }, |
| | | 'selectedIndexes, options'() { |
| | | var _a, _b, _c, _d; |
| | | const { options, selectedIndexes, keys } = this.data; |
| | | const selectedValue = []; |
| | | const steps = []; |
| | | const items = [options]; |
| | | if (options.length > 0) { |
| | | for (let i = 0, size = selectedIndexes.length; i < size; i += 1) { |
| | | const index = selectedIndexes[i]; |
| | | const next = items[i][index]; |
| | | selectedValue.push(next[(_a = keys === null || keys === void 0 ? void 0 : keys.value) !== null && _a !== void 0 ? _a : 'value']); |
| | | steps.push(next[(_b = keys === null || keys === void 0 ? void 0 : keys.label) !== null && _b !== void 0 ? _b : 'label']); |
| | | if (next[(_c = keys === null || keys === void 0 ? void 0 : keys.children) !== null && _c !== void 0 ? _c : 'children']) { |
| | | items.push(next[(_d = keys === null || keys === void 0 ? void 0 : keys.children) !== null && _d !== void 0 ? _d : 'children']); |
| | | } |
| | | }, |
| | | value() { |
| | | this.initWithValue(); |
| | | }, |
| | | options() { |
| | | const { selectedValue, steps, items } = this.genItems(); |
| | | } |
| | | } |
| | | if (steps.length < items.length) { |
| | | steps.push(defaultOptionLabel); |
| | | } |
| | | this.setData({ |
| | | steps, |
| | | items, |
| | | selectedValue, |
| | | stepIndex: items.length - 1, |
| | | }); |
| | | }, |
| | | selectedIndexes() { |
| | | const { visible, theme } = this.properties; |
| | | const { selectedValue, steps, items } = this.genItems(); |
| | | this.setData({ |
| | | steps, |
| | | selectedValue, |
| | | stepIndex: items.length - 1, |
| | | }); |
| | | if (visible && theme === 'step') { |
| | | this.updateOptionsHeight(steps.length); |
| | | } |
| | | }, |
| | | stepIndex() { |
| | | return __awaiter(this, void 0, void 0, function* () { |
| | |
| | | }, |
| | | }; |
| | | this.methods = { |
| | | updateOptionsHeight(steps) { |
| | | const { contentHeight, stepsInitHeight, stepHeight, subTitlesHeight } = this.state; |
| | | this.setData({ |
| | | _optionsHeight: contentHeight - stepsInitHeight - subTitlesHeight - (steps - 1) * stepHeight, |
| | | }); |
| | | }, |
| | | initOptionsHeight(steps) { |
| | | return __awaiter(this, void 0, void 0, function* () { |
| | | const { theme, subTitles } = this.properties; |
| | | const { height } = yield getRect(this, `.${name}__content`); |
| | | this.state.contentHeight = height; |
| | | if (theme === 'step') { |
| | | yield Promise.all([getRect(this, `.${name}__steps`), getRect(this, `.${name}__step`)]).then(([stepsRect, stepRect]) => { |
| | | this.state.stepsInitHeight = stepsRect.height - (steps - 1) * stepRect.height; |
| | | this.state.stepHeight = stepRect.height; |
| | | }); |
| | | } |
| | | if (subTitles.length > 0) { |
| | | const { height } = yield getRect(this, `.${name}__options-title`); |
| | | this.state.subTitlesHeight = height; |
| | | } |
| | | const optionsInitHeight = this.state.contentHeight - this.state.subTitlesHeight; |
| | | this.setData({ |
| | | _optionsHeight: theme === 'step' |
| | | ? optionsInitHeight - this.state.stepsInitHeight - (steps - 1) * this.state.stepHeight |
| | | : optionsInitHeight - this.state.tabsHeight, |
| | | }); |
| | | }); |
| | | }, |
| | | initWithValue() { |
| | | if (this.data.value != null && this.data.value !== '') { |
| | | const selectedIndexes = this.getIndexesByValue(this.data.options, this.data.value); |
| | |
| | | stepIndex: value, |
| | | }); |
| | | }, |
| | | genItems() { |
| | | var _a, _b, _c, _d, _e; |
| | | const { options, selectedIndexes, keys, placeholder } = this.data; |
| | | const selectedValue = []; |
| | | const steps = []; |
| | | const items = [parseOptions(options, keys)]; |
| | | if (options.length > 0) { |
| | | let current = options; |
| | | for (let i = 0, size = selectedIndexes.length; i < size; i += 1) { |
| | | const index = selectedIndexes[i]; |
| | | const next = current[index]; |
| | | current = next[(_a = keys === null || keys === void 0 ? void 0 : keys.children) !== null && _a !== void 0 ? _a : 'children']; |
| | | selectedValue.push(next[(_b = keys === null || keys === void 0 ? void 0 : keys.value) !== null && _b !== void 0 ? _b : 'value']); |
| | | steps.push(next[(_c = keys === null || keys === void 0 ? void 0 : keys.label) !== null && _c !== void 0 ? _c : 'label']); |
| | | if (next[(_d = keys === null || keys === void 0 ? void 0 : keys.children) !== null && _d !== void 0 ? _d : 'children']) { |
| | | items.push(parseOptions(next[(_e = keys === null || keys === void 0 ? void 0 : keys.children) !== null && _e !== void 0 ? _e : 'children'], keys)); |
| | | } |
| | | } |
| | | } |
| | | if (steps.length < items.length) { |
| | | steps.push(placeholder); |
| | | } |
| | | return { |
| | | selectedValue, |
| | | steps, |
| | | items, |
| | | }; |
| | | }, |
| | | handleSelect(e) { |
| | | var _a, _b, _c, _d; |
| | | var _a, _b, _c; |
| | | const { level } = e.target.dataset; |
| | | const { value } = e.detail; |
| | | const { selectedIndexes, items, keys, options } = this.data; |
| | | const { selectedIndexes, items, keys } = this.data; |
| | | const index = items[level].findIndex((item) => { var _a; return item[(_a = keys === null || keys === void 0 ? void 0 : keys.value) !== null && _a !== void 0 ? _a : 'value'] === value; }); |
| | | let item = selectedIndexes.slice(0, level).reduce((acc, item, index) => { |
| | | var _a; |
| | | if (index === 0) { |
| | | return acc[item]; |
| | | } |
| | | return acc[(_a = keys === null || keys === void 0 ? void 0 : keys.children) !== null && _a !== void 0 ? _a : 'children'][item]; |
| | | }, options); |
| | | if (level === 0) { |
| | | item = item[index]; |
| | | } |
| | | else { |
| | | item = item[(_a = keys === null || keys === void 0 ? void 0 : keys.children) !== null && _a !== void 0 ? _a : 'children'][index]; |
| | | } |
| | | const item = items[level][index]; |
| | | if (item.disabled) { |
| | | return; |
| | | } |
| | | selectedIndexes[level] = index; |
| | | selectedIndexes.length = level + 1; |
| | | this.triggerEvent('pick', { value: item[(_b = keys === null || keys === void 0 ? void 0 : keys.value) !== null && _b !== void 0 ? _b : 'value'], index, level }); |
| | | const { items: newItems } = this.genItems(); |
| | | if ((_d = item === null || item === void 0 ? void 0 : item[(_c = keys === null || keys === void 0 ? void 0 : keys.children) !== null && _c !== void 0 ? _c : 'children']) === null || _d === void 0 ? void 0 : _d.length) { |
| | | this.setData({ |
| | | selectedIndexes, |
| | | [`items[${level + 1}]`]: newItems[level + 1], |
| | | }); |
| | | this.triggerEvent('pick', { value: item[(_a = keys === null || keys === void 0 ? void 0 : keys.value) !== null && _a !== void 0 ? _a : 'value'], index, level }); |
| | | if ((_c = item === null || item === void 0 ? void 0 : item[(_b = keys === null || keys === void 0 ? void 0 : keys.children) !== null && _b !== void 0 ? _b : 'children']) === null || _c === void 0 ? void 0 : _c.length) { |
| | | this.setData({ selectedIndexes }); |
| | | } |
| | | else { |
| | | this.setData({ |
| | | selectedIndexes, |
| | | }, () => { |
| | | this.setData({ selectedIndexes }, () => { |
| | | var _a; |
| | | const { items } = this.data; |
| | | this._trigger('change', { |
| | |
| | | { |
| | | "component": true, |
| | | "styleIsolation": "apply-shared", |
| | | "usingComponents": { |
| | | "t-icon": "../icon/icon", |
| | | "t-popup": "../popup/popup", |
| | |
| | | <view wx:if="{{theme == 'step'}}" class="{{name}}__steps"> |
| | | <view wx:for="{{steps}}" wx:key="index" class="{{name}}__step" bind:tap="onStepClick" data-index="{{index}}"> |
| | | <view |
| | | class="{{name}}__step-dot {{name}}__step-dot--{{item !== placeholder ? 'active' : ''}} {{name}}__step-dot--{{index === steps.length - 1 ? 'last' : ''}}" |
| | | class="{{name}}__step-dot {{name}}__step-dot--{{item !== defaultOptionLabel ? 'active' : ''}} {{name}}__step-dot--{{index === steps.length - 1 ? 'last' : ''}}" |
| | | ></view> |
| | | <view class="{{name}}__step-label {{name}}__step-label--{{index === stepIndex ? 'active' : ''}}"> |
| | | {{ item }} |
| | |
| | | class="{{name}}__options" |
| | | scroll-y |
| | | scroll-top="{{scrollTopList[index]}}" |
| | | type="list" |
| | | style="height: {{_optionsHeight}}px" |
| | | > |
| | | <view class="cascader-radio-group-{{index}}"> |
| | | <t-radio-group |
| | |
| | | .t-cascader { |
| | | display: flex; |
| | | flex-direction: column; |
| | | background-color: var(--td-cascader-bg-color, var(--td-bg-color-container, var(--td-font-white-1, #ffffff))); |
| | | color: var(--td-cascader-title-color, var(--td-text-color-primary, var(--td-font-gray-1, rgba(0, 0, 0, 0.9)))); |
| | | border-radius: var(--td-radius-extra-large, 24rpx) var(--td-radius-extra-large, 24rpx) 0 0; |
| | | background-color: #fff; |
| | | color: var(--td-cascader-title-color, var(--td-font-gray-1, rgba(0, 0, 0, 0.9))); |
| | | border-radius: 24rpx 24rpx 0 0; |
| | | --td-radio-icon-checked-color: var(--td-cascader-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9))); |
| | | --td-tab-item-active-color: var(--td-cascader-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9))); |
| | | --td-tab-track-color: var(--td-cascader-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9))); |
| | | } |
| | | .t-cascader__close-btn { |
| | | right: 32rpx; |
| | | top: 24rpx; |
| | | right: 16px; |
| | | top: 12px; |
| | | position: absolute; |
| | | } |
| | | .t-cascader__title { |
| | | position: relative; |
| | | font-weight: 700; |
| | | text-align: center; |
| | | line-height: var(--td-cascader-title-height, 26rpx); |
| | | padding: var(--td-cascader-title-padding, var(--td-spacer-2, 32rpx)); |
| | | line-height: 48px; |
| | | font-size: var(--td-cascder-title-font-size, 36rpx); |
| | | } |
| | | .t-cascader__content { |
| | | width: 100%; |
| | | height: var(--td-cascader-content-height, 78vh); |
| | | flex: 1; |
| | | display: flex; |
| | | flex-direction: column; |
| | | } |
| | | .t-cascader__options { |
| | | width: 100vw; |
| | | height: var(--td-cascader-options-height, 640rpx); |
| | | } |
| | | .t-cascader__options-title { |
| | | color: var(--td-cascader-options-title-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4)))); |
| | | font-size: var(--td-font-size-base, 28rpx); |
| | | margin-top: 40rpx; |
| | | color: var(--td-cascader-options-title-color, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))); |
| | | font-size: 28rpx; |
| | | line-height: 44rpx; |
| | | padding-top: 40rpx; |
| | | padding-left: var(--td-spacer-2, 32rpx); |
| | | box-sizing: border-box; |
| | | padding-left: 16px; |
| | | } |
| | | .t-cascader__options-content { |
| | | flex: 1; |
| | | height: 100%; |
| | | overflow: auto; |
| | | padding-left: 16px; |
| | | } |
| | | .t-cascader__options-container { |
| | | flex: 1; |
| | | display: flex; |
| | | transition: all ease 0.3s; |
| | | } |
| | |
| | | bottom: 0; |
| | | left: unset; |
| | | right: unset; |
| | | background-color: var(--td-cascader-border-color, var(--td-component-stroke, var(--td-gray-color-3, #e7e7e7))); |
| | | background-color: var(--td-cascader-border-color, var(--td-border-color, var(--td-gray-color-3, #e7e7e7))); |
| | | } |
| | | .t-cascader__steps::after { |
| | | height: 1px; |
| | |
| | | width: var(--td-cascader-step-dot-size, 16rpx); |
| | | height: var(--td-cascader-step-dot-size, 16rpx); |
| | | border-radius: 50%; |
| | | border: 2rpx solid var(--td-cascader-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9))); |
| | | border: 1px solid var(--td-cascader-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9))); |
| | | box-sizing: border-box; |
| | | } |
| | | .t-cascader__step-dot:not(.t-cascader__step-dot--last)::after { |
| | |
| | | left: 50%; |
| | | top: calc(var(--td-cascader-step-dot-size, 16rpx) + 14rpx); |
| | | height: 36rpx; |
| | | width: 2rpx; |
| | | width: 1px; |
| | | background: var(--td-cascader-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9))); |
| | | transform: translateX(-50%); |
| | | } |
| | |
| | | border-color: var(--td-cascader-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9))); |
| | | } |
| | | .t-cascader__step-label { |
| | | padding-left: var(--td-spacer-2, 32rpx); |
| | | font-size: var(--td-font-size-m, 32rpx); |
| | | padding-left: 16px; |
| | | font-size: 16px; |
| | | } |
| | | .t-cascader__step-label--active { |
| | | color: var(--td-cascader-active-color, var(--td-brand-color, var(--td-primary-color-7, #0052d9))); |
| | | font-weight: 600; |
| | | } |
| | | .t-cascader__step-arrow { |
| | | color: var(--td-cascader-step-arrow-color, var(--td-text-color-placeholder, var(--td-font-gray-3, rgba(0, 0, 0, 0.4)))); |
| | | color: var(--td-cascader-step-arrow-color, var(--td-font-gray-3, rgba(0, 0, 0, 0.4))); |
| | | margin-left: auto; |
| | | } |
| | |
| | | type: Array, |
| | | value: [], |
| | | }, |
| | | placeholder: { |
| | | type: String, |
| | | value: 'éæ©é项', |
| | | }, |
| | | subTitles: { |
| | | type: Array, |
| | | value: [], |
| | |
| | | type: ArrayConstructor; |
| | | value?: Array<CascaderOption>; |
| | | }; |
| | | placeholder?: { |
| | | type: StringConstructor; |
| | | value?: string; |
| | | }; |
| | | subTitles?: { |
| | | type: ArrayConstructor; |
| | | value?: Array<string>; |
| | |
| | | import { toLabel as toLabelMonitor } from '../common/dataMonitorDeviceType'; |
| | | import { toLabel as toLabelTreatment } from '../common/dataTreatmentDeviceType'; |
| | | import { toLabel as toLabelProduction } from '../common/dataProductionDeviceType'; |
| | | import { inspectPicUrl } from '../config/index'; |
| | | |
| | | // çæµè®¾å¤ |
| | | export function getMonitorDevice(data) { |
| | | data._name = data.diName |
| | | data._deviceCode = data.diDeviceCode |
| | | data._updateTime = dayjs(data.diUpdateTime).format('YYYYå¹´MMæDDæ¥'); |
| | | data._maintainFrequency = toLabelFreq(data.diMaintainFrequency); |
| | | data._ownership = toLabelOwner(data.diOwnership); |
| | |
| | | const labelArr = toLabelMonitor(data.diSceneTypeId, [data.diTypeId, data.diSubtypeId]); |
| | | data._type = labelArr[0]; |
| | | data._subType = labelArr[1]; |
| | | return data |
| | | return data; |
| | | } |
| | | |
| | | // æ²»çè®¾å¤ |
| | | export function getTreatmentDevice(data) { |
| | | data._name = data.piName |
| | | data._deviceCode = data.piDeviceCode |
| | | data._updateTime = dayjs(data.piUpdateTime).format('YYYYå¹´MMæDDæ¥'); |
| | | data._maintainFrequency = toLabelFreq(data.piMaintainFrequency); |
| | | data._ownership = toLabelOwner(data.piOwnership); |
| | |
| | | const labelArr = toLabelTreatment(data.piSceneTypeId, [data.piTypeId, data.piSubtypeId]); |
| | | data._type = labelArr[0]; |
| | | data._subType = labelArr[1]; |
| | | return data |
| | | return data; |
| | | } |
| | | |
| | | // çäº§è®¾å¤ |
| | | export function getProductionDevice(data) { |
| | | data._name = data.wiName |
| | | data._deviceCode = data.wiDeviceCode |
| | | data._updateTime = dayjs(data.wiUpdateTime).format('YYYYå¹´MMæDDæ¥'); |
| | | data._ownership = toLabelOwner(data.wiOwnership); |
| | | data._runningStatus = toLabelStatus(data.wiRunningStatus); |
| | | const labelArr = toLabelProduction(data.wiSceneTypeId, [data.wiTypeId, data.wiSubtypeId]); |
| | | data._type = labelArr[0]; |
| | | data._subType = labelArr[1]; |
| | | return data |
| | | return data; |
| | | } |
| | | |
| | | export function getDeviceList(dataList, deviceType) { |
| | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | export function getDeviceStatus(data) { |
| | | data._createTime = dayjs(data.dlCreateTime).format('YYYYå¹´MMæDDæ¥'); |
| | | data._imgPath = data.dlPicUrl.split(';').map(p => inspectPicUrl + p); |
| | | return data; |
| | | } |
| | | |
| | | export function getDeviceStatusList(dataList) { |
| | | return dataList.map(item => { |
| | | return getDeviceStatus(item); |
| | | }); |
| | | } |
| | |
| | | |
| | | bindYearChange(e) { |
| | | let year = `${e.detail.value}`; |
| | | debugger |
| | | if (this.data.year != year) { |
| | | this.setData({ |
| | | year, |
| | |
| | | |
| | | onLoad(options) {}, |
| | | |
| | | onShow() { |
| | | this.getTabBar().init(); |
| | | }, |
| | | |
| | | onReachBottom() { |
| | | this._loadMore(); |
| | | }, |
| | |
| | | style-mode="picker" |
| | | picker-class="picker-location" |
| | | bind:onChange="onLocationChange" |
| | | bind:locationInitValue="onLocationChange" |
| | | ></location-picker> |
| | | </view> |
| | | <view class="filter-wrap-2"> |
| | | <scene-picker sceneMode="{{1}}" bind:scenePickerChange="onScenePickerConfirm" bind:sceneInitValue="onScenePickerConfirm"/> |
| | | <scene-picker |
| | | sceneMode="{{1}}" |
| | | bind:scenePickerChange="onScenePickerConfirm" |
| | | bind:sceneInitValue="onScenePickerConfirm" |
| | | /> |
| | | </view> |
| | | </view> |
| | | </t-sticky> |
| | |
| | | <view wx:if="{{time}}" class="flex-h"> |
| | | <view wx:if="{{_createTime}}" class="flex-h"> |
| | | <!-- <t-divider content="åæ´æ¶é´: {{time}}" align="left" /> --> |
| | | <view>{{index}}. åæ´æ¶é´: {{time}}</view> |
| | | <view wx:if="{{readOnly}}"> |
| | | <view>{{index}}. åæ´æ¶é´: {{_createTime}}</view> |
| | | <!-- <view wx:if="{{readOnly}}"> |
| | | <t-button theme="primary" size="extra-small" bind:tap="changeEdit">ä¿®æ¹</t-button> |
| | | </view> --> |
| | | </view> |
| | | </view> |
| | | <t-input |
| | | label="å®è£
ä½ç½®" |
| | | placeholder="请è¾å
¥å®è£
ä½ç½®" |
| | | model:value="{{dlLocation}}" |
| | | disabled="{{readOnly}}" |
| | | /> |
| | | <t-input |
| | | label="ç»åº¦" |
| | | placeholder="请è¾å
¥ç»åº¦" |
| | | model:value="{{dlLongitude}}" |
| | | disabled="{{readOnly}}" |
| | | /> |
| | | <t-input |
| | | label="维度" |
| | | placeholder="请è¾å
¥ç»´åº¦" |
| | | model:value="{{dlLatitude}}" |
| | | disabled="{{readOnly}}" |
| | | /> |
| | | <t-cell title="æ¯å¦è§è"> |
| | | <t-switch |
| | | model:value="{{dlStandard}}" |
| | |
| | | /> |
| | | </t-cell> |
| | | <t-input |
| | | label="设å¤ä½ç½®" |
| | | placeholder="请è¾å
¥å®è£
ä½ç½®" |
| | | model:value="{{dlLocation}}" |
| | | disabled="{{readOnly}}" |
| | | /> |
| | | <!-- <t-input |
| | | label="ç»åº¦" |
| | | placeholder="请è¾å
¥ç»åº¦" |
| | | model:value="{{dlLongitude}}" |
| | | disabled="{{readOnly}}" |
| | | /> |
| | | <t-input |
| | | label="维度" |
| | | placeholder="请è¾å
¥ç»´åº¦" |
| | | model:value="{{dlLatitude}}" |
| | | disabled="{{readOnly}}" |
| | | /> --> |
| | | <t-input |
| | | wx:if="{{!dlStandard}}" |
| | | label="ä¸è§è说æ" |
| | | placeholder="请è¾å
¥è¯´æ" |
| | | model:value="{{dlUnstandardReason}}" |
| | | disabled="{{readOnly}}" |
| | | /> |
| | | <!-- <t-input |
| | | label="æ´æ°æ¶é´" |
| | | placeholder="请è¾å
¥æ´æ°æ¶é´" |
| | | model:value="{{_createTime}}" |
| | | disabled="{{readOnly}}" |
| | | /> --> |
| | | <block wx:if="{{_imgPath.length > 0}}"> |
| | | <t-cell title="ç°åºå¾ç"> |
| | | <view class="img-group" slot="description"> |
| | | <view wx:for="{{_imgPath}}" wx:key="index" wx:for-item="m"> |
| | | <t-image |
| | | src="{{m}}" |
| | | t-class="img-group_img" |
| | | shape="round" |
| | | bindtap="previewImage" |
| | | data-index="{{index}}" |
| | | /> |
| | | </view> |
| | | </view> |
| | | </t-cell> |
| | | </block> |
| | | <view wx:if="{{!readOnly}}" style="display: flex; gap: 4"> |
| | | <t-button theme="light" block size="small" bind:tap="cancel">åæ¶</t-button> |
| | | <t-button wx:if="{{!isUpdate}}" theme="primary" block block size="small" bind:tap="confirm" |
| | |
| | | > |
| | | <t-button wx:else theme="primary" block block size="small" bind:tap="update">æ´æ°</t-button> |
| | | </view> |
| | | <!-- <t-divider /> --> |
| | | <t-divider /> |
| | |
| | | padding: 0 16px; |
| | | margin-top: 8px; |
| | | } |
| | | |
| | | .img-group { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | gap: 2px; |
| | | } |
| | | |
| | | .img-group .img-group_img { |
| | | width: 30vw; |
| | | height: 30vw; |
| | | } |
| | |
| | | hideInputItem('åºæ¯id', 'piSceneGuid'), |
| | | hideInputItem('åºæ¯ç±»å', 'piSceneTypeId'), |
| | | |
| | | baseInputItem('ç«ç¹åç§°', 'piName', true), |
| | | baseInputItem('设å¤åç§°', 'piName', true), |
| | | baseInputItem('设å¤ç¼å·', 'piDeviceCode'), |
| | | // 设å¤ç±»åå设å¤åç±»åå¹¶ç¨çº§èéæ©å¨å±ç¤º |
| | | baseInputItem( |
| | |
| | | hideInputItem('åºæ¯id', 'piSceneGuid'), |
| | | hideInputItem('åºæ¯ç±»å', 'piSceneTypeId'), |
| | | |
| | | baseInputItem('ç«ç¹åç§°', 'piName', true), |
| | | baseInputItem('设å¤åç§°', 'piName', true), |
| | | baseInputItem('设å¤ç¼å·', 'piDeviceCode'), |
| | | // 设å¤ç±»åå设å¤åç±»åå¹¶ç¨çº§èéæ©å¨å±ç¤º |
| | | baseInputItem( |
| | |
| | | <block wx:for="{{item.items}}" wx:key="index1" wx:for-item="device" wx:for-index="index1"> |
| | | <view class="scene__item" > |
| | | <view class="flex-h" style="align-items: flex-start"> |
| | | <view class="scene__item-name">{{device.diName}} </view> |
| | | <view class="scene__item-name">{{device._name}} </view> |
| | | <view> |
| | | <t-tag |
| | | max-width="{{130}}" |
| | |
| | | </view> |
| | | </view> |
| | | <view class="flex-h"> |
| | | <view class="scene__item-abstract">ç¼å·ï¼{{device.diDeviceCode}} </view> |
| | | <view class="scene__item-abstract">ç¼å·ï¼{{device._deviceCode}} </view> |
| | | <view class="scene__item-abstract">{{device._runningStatus}} </view> |
| | | </view> |
| | | <view class="scene__item-abstract">æ´æ°æ¶é´ï¼{{device._updateTime}} </view> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | // pages/inspection/scene/search/components/scene-search-result/index.js |
| | | Component({ |
| | | options: { |
| | | addGlobalClass: true, |
| | | }, |
| | | /** |
| | | * ç»ä»¶ç屿§å表 |
| | | */ |
| | | properties: { |
| | | result: { |
| | | type: Object, |
| | | value: { |
| | | name: '', |
| | | districtname: '', |
| | | type: '', |
| | | }, |
| | | }, |
| | | }, |
| | | |
| | | /** |
| | | * ç»ä»¶çåå§æ°æ® |
| | | */ |
| | | data: { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * ç»ä»¶çæ¹æ³å表 |
| | | */ |
| | | methods: { |
| | | handCellClick(e) { |
| | | this.triggerEvent('click', this.data.result); |
| | | }, |
| | | } |
| | | }) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "component": true, |
| | | "usingComponents": {} |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <t-cell title="{{result.name}}" hover bind:click="handCellClick"> |
| | | <view slot="description" class="enterprise-info__tag"> |
| | | <t-tag |
| | | max-width="{{130}}" |
| | | shape="square" |
| | | size="small" |
| | | theme="{{result.extension1 == '1' ? 'success' : 'danger'}}" |
| | | variant="light-outline" |
| | | disabled |
| | | >{{result.extension1 == '1' ? 'ä¸çº¿ä¸' : 'å·²ä¸çº¿'}}</t-tag |
| | | > |
| | | <t-tag |
| | | t-class="t-class-tag" |
| | | max-width="{{130}}" |
| | | shape="square" |
| | | size="small" |
| | | theme="default" |
| | | variant="light" |
| | | >{{result.districtname}}</t-tag |
| | | > |
| | | <t-tag |
| | | t-class="t-class-tag" |
| | | max-width="{{130}}" |
| | | shape="square" |
| | | size="small" |
| | | theme="default" |
| | | variant="light" |
| | | >{{result.type}}</t-tag |
| | | > |
| | | </view> |
| | | </t-cell> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | .enterprise-info__tag { |
| | | display: flex; |
| | | justify-content: flex-end; |
| | | } |
| | | |
| | | .t-class-tag { |
| | | margin-left: 16rpx; |
| | | } |
| | |
| | | // pages/inspection/scene/search/index.js |
| | | import { fetchEnterprise } from '../../../../services/enterprise/fetchEnterprise'; |
| | | import { searchScene } from '../../../../services/inspection/fetchScene'; |
| | | import { useLoading } from '../../../../behaviors/loading'; |
| | | |
| | | Page({ |
| | | |
| | | /** |
| | | * 页é¢çåå§æ°æ® |
| | | */ |
| | | behaviors: [useLoading], |
| | | data: { |
| | | |
| | | placeholder: 'è¾å
¥å
³é®è¯æç´¢åºæ¯', |
| | | searchValue: '', |
| | | isSearch: false, |
| | | searchResult: [], |
| | | historyWords: [], |
| | | dialog: { |
| | | title: '确认å é¤å½ååå²è®°å½', |
| | | showCancelButton: true, |
| | | message: '', |
| | | }, |
| | | dialogShow: false, |
| | | }, |
| | | |
| | | /** |
| | | * çå½å¨æå½æ°--çå¬é¡µé¢å è½½ |
| | | */ |
| | | onLoad(options) { |
| | | historyTag: 'historyScene', |
| | | deleteType: 0, |
| | | deleteIndex: '', |
| | | |
| | | }, |
| | | onLoad(options) {}, |
| | | |
| | | /** |
| | | * çå½å¨æå½æ°--çå¬é¡µé¢å次渲æå®æ |
| | | */ |
| | | onReady() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * çå½å¨æå½æ°--çå¬é¡µé¢æ¾ç¤º |
| | | */ |
| | | onShow() { |
| | | |
| | | this.queryHistory(); |
| | | }, |
| | | |
| | | /** |
| | | * çå½å¨æå½æ°--çå¬é¡µé¢éè |
| | | */ |
| | | onHide() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * çå½å¨æå½æ°--çå¬é¡µé¢å¸è½½ |
| | | */ |
| | | onUnload() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 页é¢ç¸å
³äºä»¶å¤ç彿°--çå¬ç¨æ·ä¸æå¨ä½ |
| | | */ |
| | | onPullDownRefresh() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 页é¢ä¸æè§¦åºäºä»¶çå¤ç彿° |
| | | */ |
| | | onReachBottom() { |
| | | |
| | | this._loadMore(); |
| | | }, |
| | | |
| | | /** |
| | | * ç¨æ·ç¹å»å³ä¸è§å享 |
| | | */ |
| | | onShareAppMessage() { |
| | | queryHistory() { |
| | | wx.getStorage({ |
| | | key: this.historyTag, |
| | | success: res => { |
| | | this.setData({ |
| | | historyWords: res.data, |
| | | }); |
| | | }, |
| | | }); |
| | | }, |
| | | |
| | | //å é¤æä¸ªåå²è®°å½ |
| | | deleteCurr(e) { |
| | | const { index } = e.currentTarget.dataset; |
| | | const { dialog } = this.data; |
| | | this.deleteIndex = index; |
| | | this.setData({ |
| | | dialog: { |
| | | ...dialog, |
| | | message: '确认å é¤å½ååå²è®°å½', |
| | | deleteType: 0, |
| | | }, |
| | | dialogShow: true, |
| | | }); |
| | | }, |
| | | |
| | | //æ¸
空åå²è®°å½ |
| | | handleClearHistory() { |
| | | const { dialog } = this.data; |
| | | this.deleteType = 1; |
| | | this.setData({ |
| | | dialog: { |
| | | ...dialog, |
| | | message: '确认å 餿æåå²è®°å½', |
| | | }, |
| | | dialogShow: true, |
| | | }); |
| | | }, |
| | | |
| | | confirm() { |
| | | const { historyWords } = this.data; |
| | | const { deleteType, deleteIndex } = this; |
| | | if (deleteType === 0) { |
| | | historyWords.splice(deleteIndex, 1); |
| | | this.setData({ |
| | | historyWords, |
| | | dialogShow: false, |
| | | }); |
| | | } else { |
| | | this.setData({ historyWords: [], dialogShow: false }); |
| | | } |
| | | }) |
| | | wx.setStorage({ |
| | | key: this.historyTag, |
| | | data: [], |
| | | }); |
| | | }, |
| | | |
| | | close() { |
| | | this.setData({ dialogShow: false }); |
| | | }, |
| | | |
| | | //ç¹å»åå²è®°å½ |
| | | handleHistoryTap(e) { |
| | | const { historyWords } = this.data; |
| | | const { dataset } = e.currentTarget; |
| | | const _searchValue = historyWords[dataset.index || 0] || ''; |
| | | if (_searchValue) { |
| | | this.setData({ searchValue: _searchValue }); |
| | | this._startLoad(); |
| | | } |
| | | }, |
| | | |
| | | //ç¹å»æç´¢ |
| | | handleSubmit() { |
| | | const { historyWords, searchValue } = this.data; |
| | | if (historyWords.indexOf(searchValue) == -1) { |
| | | historyWords.push(searchValue); |
| | | this.setData({ historyWords }); |
| | | } |
| | | wx.setStorage({ |
| | | key: this.historyTag, |
| | | data: historyWords, |
| | | }); |
| | | this._startLoad(); |
| | | }, |
| | | |
| | | //æ¸
é¤æç´¢ |
| | | handleClear() { |
| | | this.setData({ searchValue: '', searchResult: [], isSearch: false }); |
| | | }, |
| | | |
| | | handleChange() { |
| | | if (this.data.searchValue == '') { |
| | | this.setData({ searchResult: [], isSearch: false }); |
| | | } |
| | | }, |
| | | |
| | | _fetchData(page) { |
| | | const { searchValue } = this.data; |
| | | if (searchValue.length === 0) return; |
| | | this.setData({ isSearch: true }); |
| | | const area = { |
| | | sceneName: searchValue, |
| | | }; |
| | | return searchScene(area, page).then(res => { |
| | | this.setData({ |
| | | searchResult: page == 1 ? res.data : this.data.searchResult.concat(res.data), |
| | | }); |
| | | return res.head; |
| | | }); |
| | | }, |
| | | |
| | | handCellClick(e) { |
| | | const scene = e.detail; |
| | | wx.navigateTo({ |
| | | url: '/pages/inspection/scene/info/index', |
| | | success: result => { |
| | | result.eventChannel.emit('acceptSceneData', { |
| | | scene: scene, |
| | | }); |
| | | }, |
| | | }); |
| | | }, |
| | | }); |
| | |
| | | { |
| | | "usingComponents": {} |
| | | "navigationBarTitleText": "æç´¢", |
| | | "onReachBottomDistance": 10, |
| | | "usingComponents": { |
| | | "scene-search-result": "./components/scene-search-result/index" |
| | | } |
| | | } |
| | |
| | | <!--pages/inspection/scene/search/index.wxml--> |
| | | <text>pages/inspection/scene/search/index.wxml</text> |
| | | <!--pages/search/index.wxml--> |
| | | <view class="page"> |
| | | <view class="page-header"> |
| | | <t-search |
| | | placeholder="{{placeholder}}" |
| | | model:value="{{searchValue}}" |
| | | bind:submit="handleSubmit" |
| | | bind:clear="handleClear" |
| | | bind:change="handleChange" |
| | | focus |
| | | > |
| | | </t-search> |
| | | </view> |
| | | |
| | | <view class="page-container"> |
| | | <scene-search-result |
| | | wx:for="{{searchResult}}" |
| | | wx:key="index" |
| | | wx:for-index="index" |
| | | result="{{item}}" |
| | | bind:click="handCellClick" |
| | | ></scene-search-result> |
| | | <load-more |
| | | list-is-empty="{{!searchResult.length}}" |
| | | status="{{loadStatus}}" |
| | | bind:retry="_startLoad" |
| | | /> |
| | | <t-empty |
| | | wx:if="{{loadStatus == 2 && isSearch && searchResult.length == 0}}" |
| | | icon="info-circle-filled" |
| | | description="æ å¹é
è®°å½" |
| | | /> |
| | | <block wx:if="{{!isSearch}}"> |
| | | <view wx:if="{{historyWords.length > 0}}" class="history-wrap"> |
| | | <view class="search-header"> |
| | | <text class="search-title">åå²æç´¢</text> |
| | | <text class="search-clear" bind:tap="handleClearHistory">æ¸
é¤</text> |
| | | </view> |
| | | <view class="search-content"> |
| | | <view |
| | | class="search-item" |
| | | hover-class="hover-history-item" |
| | | wx:for="{{historyWords}}" |
| | | bind:tap="handleHistoryTap" |
| | | bindlongpress="deleteCurr" |
| | | data-index="{{index}}" |
| | | wx:key="index" |
| | | > |
| | | {{item}} |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <t-empty |
| | | wx:else |
| | | t-class-image="t-empty__image" |
| | | image="/res/nodata.png" |
| | | description="请æç´¢" |
| | | /> |
| | | </block> |
| | | </view> |
| | | <view class="page-footer"></view> |
| | | <t-dialog |
| | | visible="{{dialogShow}}" |
| | | content="{{dialog.message}}" |
| | | bindconfirm="confirm" |
| | | bind:close="close" |
| | | confirm-btn="ç¡®å®" |
| | | cancel-btn="{{dialog.showCancelButton ? 'åæ¶' : null}}" |
| | | t-class-confirm="add-notes__confirm" |
| | | /> |
| | | </view> |
| | |
| | | /* pages/inspection/scene/search/index.wxss */ |
| | | .page { |
| | | background-color: var(--td-white-color1); |
| | | } |
| | | |
| | | .history-wrap { |
| | | margin-top: 44rpx; |
| | | } |
| | | |
| | | .search-header { |
| | | display: flex; |
| | | flex-flow: row nowrap; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | } |
| | | |
| | | .search-title { |
| | | font-size: 30rpx; |
| | | font-family: PingFangSC-Semibold, PingFang SC; |
| | | font-weight: 600; |
| | | color: rgba(51, 51, 51, 1); |
| | | line-height: 42rpx; |
| | | } |
| | | |
| | | .search-clear { |
| | | font-size: 24rpx; |
| | | font-family: PingFang SC; |
| | | line-height: 32rpx; |
| | | color: #999999; |
| | | font-weight: normal; |
| | | } |
| | | |
| | | .search-content { |
| | | overflow: hidden; |
| | | display: flex; |
| | | flex-flow: row wrap; |
| | | justify-content: flex-start; |
| | | align-items: flex-start; |
| | | margin-top: 24rpx; |
| | | } |
| | | |
| | | .search-item { |
| | | color: #333333; |
| | | font-size: 24rpx; |
| | | line-height: 32rpx; |
| | | font-weight: normal; |
| | | margin-right: 24rpx; |
| | | margin-bottom: 24rpx; |
| | | background: #f5f5f5; |
| | | border-radius: 38rpx; |
| | | padding: 12rpx 24rpx; |
| | | } |
| | | |
| | | .add-notes__confirm { |
| | | color: #fa4126 !important; |
| | | /* color: #0d80a3 !important; */ |
| | | } |
| | | |
| | | .t-empty__image { |
| | | width: 240rpx !important; |
| | | height: 240rpx !important; |
| | | } |
| | |
| | | }, |
| | | |
| | | logout() { |
| | | app.globalData.onLaunch.forEach(fun => { |
| | | if (typeof fun === 'function') { |
| | | fun(); |
| | | } |
| | | }); |
| | | wx.reLaunch({ |
| | | url: '/pages/usercenter/login/login-home/index', |
| | | }); |
| | |
| | | export const menuData = [ |
| | | [ |
| | | { |
| | | title: 'ç°åºç管', |
| | | title: '设å¤ç®¡ç', |
| | | tit: '', |
| | | url: '', |
| | | type: 'supervision', |
| | |
| | | "description": "项ç®ç§æé
ç½®æä»¶ãæ¤æä»¶ä¸çå
容å°è¦ç project.config.json ä¸çç¸ååæ®µã项ç®çæ¹å¨ä¼å
忥尿¤æä»¶ä¸ãè¯¦è§ææ¡£ï¼https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", |
| | | "projectname": "ep-law-abiding-manage-weixin", |
| | | "setting": { |
| | | "compileHotReLoad": true, |
| | | "compileHotReLoad": false, |
| | | "urlCheck": false |
| | | }, |
| | | "libVersion": "3.4.10" |
| | | "libVersion": "3.5.3" |
| | | } |
| | |
| | | import { get, post, put } from '../baseRequset'; |
| | | import { inspectUrl, inspectPicUrl } from '../../config/index'; |
| | | import { transSceneType } from '../../model/sceneType'; |
| | | import { getDeviceList } from '../../model/device'; |
| | | import { getDeviceList, getDeviceStatusList } from '../../model/device'; |
| | | |
| | | /** |
| | | * è·ååºæ¯è®¾å¤åºæ¬ä¿¡æ¯ |
| | |
| | | }, |
| | | inspectUrl, |
| | | ).then(res => { |
| | | res.data.data = getDeviceStatusList(res.data.data) |
| | | return res.data; |
| | | }); |
| | | } |
| | |
| | | }, |
| | | inspectUrl, |
| | | ).then(res => { |
| | | res.data.data = getInspectionStatisticList(res.data.data); |
| | | return res.data; |
| | | // res.data = getInspectionStatisticList(res.data); |
| | | // return res; |
| | | // res.data.data = getInspectionStatisticList(res.data.data); |
| | | // return res.data; |
| | | res.data = getInspectionStatisticList(res.data); |
| | | return res; |
| | | }); |
| | | } |
| | | |