|
@@ -1,4 +1,4 @@
|
|
-import { defineComponent, nextTick, onMounted, reactive, ref } from 'vue';
|
|
|
|
|
|
+import { computed, defineComponent, nextTick, onMounted, reactive, ref } from 'vue';
|
|
import styles from './index.module.less';
|
|
import styles from './index.module.less';
|
|
import {
|
|
import {
|
|
NButton,
|
|
NButton,
|
|
@@ -39,6 +39,18 @@ export default defineComponent({
|
|
details: {} as any,
|
|
details: {} as any,
|
|
selectCheckboxs: [] as any
|
|
selectCheckboxs: [] as any
|
|
});
|
|
});
|
|
|
|
+
|
|
|
|
+ const isDisabled = computed(() => {
|
|
|
|
+ const boxs = state.selectCheckboxs;
|
|
|
|
+ let flag = false;
|
|
|
|
+ for (const i in boxs) {
|
|
|
|
+ if (boxs[i].length > 0) {
|
|
|
|
+ flag = true;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return !flag;
|
|
|
|
+ });
|
|
|
|
|
|
const getDetails = async () => {
|
|
const getDetails = async () => {
|
|
show.value = true;
|
|
show.value = true;
|
|
@@ -125,7 +137,6 @@ export default defineComponent({
|
|
);
|
|
);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
const result: any[] = [];
|
|
const result: any[] = [];
|
|
items.forEach(item => {
|
|
items.forEach(item => {
|
|
result.push({
|
|
result.push({
|
|
@@ -366,7 +377,7 @@ export default defineComponent({
|
|
<NButton round onClick={() => emit('close')}>
|
|
<NButton round onClick={() => emit('close')}>
|
|
取消
|
|
取消
|
|
</NButton>
|
|
</NButton>
|
|
- <NButton round type="primary" onClick={onSubmit}>
|
|
|
|
|
|
+ <NButton round type="primary" onClick={onSubmit} disabled={isDisabled.value}>
|
|
确认添加
|
|
确认添加
|
|
</NButton>
|
|
</NButton>
|
|
</NSpace>
|
|
</NSpace>
|