删除权限
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listCategory } from '@/api/wms/category';
|
||||
import { mapState, mapActions } from 'vuex';
|
||||
|
||||
export default {
|
||||
name: 'CategorySelect',
|
||||
@@ -55,30 +55,29 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
categoryOptions: [],
|
||||
innerValue: this.value
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState('category', ['categoryList']),
|
||||
categoryOptions() {
|
||||
return this.categoryList.filter(
|
||||
item => item.categoryType === this.categoryType && item.isEnabled === 1
|
||||
);
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
value(val) {
|
||||
this.innerValue = val;
|
||||
},
|
||||
categoryType: {
|
||||
handler() {
|
||||
this.loadOptions();
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.loadOptions();
|
||||
created() {
|
||||
if (!this.categoryList || this.categoryList.length === 0) {
|
||||
this.getCategoryList();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
loadOptions() {
|
||||
listCategory({ categoryType: this.categoryType, isEnabled: 1 }).then(res => {
|
||||
this.categoryOptions = res.rows || [];
|
||||
});
|
||||
},
|
||||
...mapActions('category', ['getCategoryList']),
|
||||
onChange(val) {
|
||||
this.$emit('input', val);
|
||||
this.$emit('change', val);
|
||||
|
||||
Reference in New Issue
Block a user