团队赛队员配置修改

main
zhc077 3 months ago
parent 96d4f1d2a5
commit bba507067b
  1. 99
      jeecgboot-vue3-master/src/views/annualCompPoint/committee/components/AnnualCompPointForm.vue

@ -302,14 +302,27 @@
@register="register" @register="register"
title="Modal Title" title="Modal Title"
> >
<div v-for="(item,index) in num" :key="index"> <!-- <div v-for="(item,index) in num" :key="index">-->
<a-input-number v-model="item.index"></a-input-number> <!-- <a-input-number v-model="item.index"></a-input-number>-->
<a-input-number v-model="item.value"></a-input-number> <!-- <a-input-number v-model="item.value"></a-input-number>-->
<a-button @click="delNum(index)">删除</a-button> <!-- <a-button @click="delNum(index)">删除</a-button>-->
</div> <!-- </div>-->
<a-button type="primary" @click="addNum" class="mr-2">从内部关闭弹窗</a-button> <!-- <a-button type="primary" @click="addNum" class="mr-2">从内部关闭弹窗</a-button>-->
<a-button type="primary" @click="setModalProps">从内部修改title</a-button> <!-- <a-button type="primary" @click="setModalProps">从内部修改title</a-button>-->
<JVxeTable
ref="tableRef"
stripe
toolbar
rowNumber
rowSelection
rowExpand
resizable
:maxHeight="480"
:columns="columns"
:dataSource="dataSource"
@save="handleTableSave"
/>
</BasicModal> </BasicModal>
</template> </template>
@ -325,6 +338,78 @@ import JPopup from '/@/components/Form/src/jeecg/components/JPopup.vue';
import {getValueType} from '/@/utils'; import {getValueType} from '/@/utils';
import {saveOrUpdate, getProjectlevel} from '../AnnualCompPoint.api'; import {saveOrUpdate, getProjectlevel} from '../AnnualCompPoint.api';
import {Form} from 'ant-design-vue'; import {Form} from 'ant-design-vue';
import { JVxeTable } from '/@/components/jeecg/JVxeTable';
import { JVxeTypes, JVxeColumn} from '/@/components/jeecg/JVxeTable/types';
const dataSource = ref([])
const columns = ref<any>([
{
title: '单行文本',
key: 'input',
type: JVxeTypes.input,
width: 180,
defaultValue: '',
placeholder: '请输入${title}',
validateRules: [
{
required: true, //
message: '请输入${title}', //
},
{
pattern: /^[a-z|A-Z][a-z|A-Z\d_-]*$/, //
message: '必须以字母开头,可包含数字、下划线、横杠',
},
{
unique: true,
message: '${title}不能重复',
},
{
handler({ cellValue, row, column }, callback, target) {
// cellValue
// callback(flag, message)
// flag = null
// message = 使 message
// target
if (cellValue === 'abc') {
callback(false, '${title}不能是abc') // false =
} else {
callback(true) // true =
}
},
message: '${title}默认提示',
},
],
},
])
function handleTableSave({ $table, target }) {
//
$table.validate().then((errMap) => {
//
if (!errMap) {
//
let tableData = target.getTableData();
console.log('当前保存的数据是:', tableData);
//
let newData = target.getNewData();
console.log('-- 新增的数据:', newData);
//
let deleteData = target.getDeleteData();
console.log('-- 删除的数据:', deleteData);
//
loading.value = true;
defHttp
.post({
url: Api.saveAll,
params: tableData,
})
.then(() => {
createMessage.success(`保存成功!`);
})
.finally(() => {
loading.value = false;
});
}
});
}
const props = defineProps({ const props = defineProps({
// objLevelll: { type: Array, default: () => [] }, // objLevelll: { type: Array, default: () => [] },
formDisabled: {type: Boolean, default: false}, formDisabled: {type: Boolean, default: false},

Loading…
Cancel
Save