12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- Component({
- properties: {
- item: {
- type: Object
- },
- jumboSize: {
- type: Boolean
- }
- },
- data: {
- active: {}
- },
- methods: {
- clearChild() {
- this.setData({
- "item.index": null,
- childClass: null
- });
- let MultilevelClass = this.selectComponent("#MultilevelClass");
- if (MultilevelClass) MultilevelClass.clearChild()
- getApp().globalData.temporaryId = null;
- },
- onSelect(e) {
- const {
- i,
- item
- } = e.currentTarget.dataset;
- let MultilevelClass = this.selectComponent("#MultilevelClass");
- if (MultilevelClass) MultilevelClass.clearChild()
- if (this.data.item.index == i) {
- getApp().globalData.temporaryId = this.data.item.id || "";
- this.setData({
- "item.index": null,
- childClass: null
- });
- } else {
- getApp().globalData.temporaryId = this.data.item.selectKey ? item[this.data.item.selectKey] : JSON.parse(JSON.stringify(item));
- this.setData({
- "item.index": i,
- childClass: item.subdep.length ? {
- index: null,
- label: item.itemclassname + '的下级分类',
- list: item.subdep,
- selectKey: this.data.item.selectKey,
- showName: this.data.item.showName,
- type: this.data.item.type,
- value: "",
- valueKey: this.data.item.valueKey,
- id: getApp().globalData.temporaryId
- } : null
- });
- };
- //商城
- getApp().globalData.setTemporaryId && getApp().globalData.setTemporaryId({
- detail: {
- temporaryId: getApp().globalData.temporaryId
- }
- })
- }
- }
- })
|