import{C as S,x as z}from"./eleVendor-99a45232-1782111760424v=1.0.0.js";import{m as K,a as b,f as P,ai as s,p as o,q as i,t as V,R as u,U as c,O as r,F as m,a8 as _,M as p,T as x,S as $,u as E,n as G}from"./vendor-7f807b9d-1782111760424v=1.0.0.js";import{_ as J}from"./index-996f931c-1782111760424v=1.0.0.js";const Q={key:0},W={key:0,class:"btmOperation",style:{marginTop:"20px"}},X=K({__name:"indexOld",props:{list:{default:[]},tableColumnList:{default:[]},isAllEditMode:{type:Boolean,default:!1},requiredIndexs:{default:[]}},emits:["update:list","submit","update:isAllEditMode"],setup(F,{emit:M}){let g=b(null),C=b(null),B=b(!1);const D=b(),h=F,I=M,Y=n=>(h.requiredIndexs,h.requiredIndexs.includes(n.columnIndex-1)?"requiredColumn":"cell-selected"),T=b({}),R=(n,t)=>{g.value===n.id&&C.value===t.no?(B.value=!0,G(()=>{const a=T.value[`${n.id}-${t.no}`];a&&a.focus()})):(B.value=!1,g.value=n.id,C.value=t.no)},U=(n,t,a)=>{const f=a.selectValues.split(",").indexOf(n);t[`${a.fieldValue}Index`]=`${f}`},O=(n,t,a)=>{a.selectValues.split(",");const w=n.map((f,y)=>y).join(",");t[`${a.fieldValue}Index`]=w},v=P({get(){return h.list},set(n){I("update:list",n)}}),N=n=>{const t=v.value.indexOf(n);t!==-1&&v.value.splice(t,1)},q=()=>{v.value.push({})};return(n,t)=>{const a=s("el-table-column"),w=s("el-input"),f=s("el-option"),y=s("el-select"),H=s("el-date-picker"),L=s("el-input-number"),A=s("el-button"),j=s("el-table");return o(),i(m,null,[t[3]||(t[3]=V("div",{tabindex:"0"},[u(` <el-button type="primary" @click="handleAdd"> \u65B0\u589E </el-button>
		<el-button type="primary" @click="handleAdd10"> \u65B0\u589E10\u4E2A\u70B9\u8868 </el-button>
		<el-button type="primary" @click="handleClean"> \u6E05\u7A7A </el-button> `)],-1)),V("div",null,[u(' @keydown.capture="handleKeydown" '),c(j,{data:E(v),style:{width:"100%"},border:"",ref_key:"myTable",ref:D,"cell-class-name":"cell-selected","header-cell-class-name":Y,height:300,onCellClick:R},{append:r(()=>t[1]||(t[1]=[])),default:r(()=>[c(a,{type:"index",label:"\u5E8F\u53F7",width:"50px"}),(o(!0),i(m,null,_(n.tableColumnList,e=>(o(),p(a,{key:e.prop,prop:e.prop,label:e.isFill?"*"+e.fieldName:e.fieldName,"min-width":e.width||"120px"},{default:r(({row:d})=>[n.isAllEditMode?(o(),i(m,{key:0},[u(" {{ item }} "),e.isFixedField?(o(),i("span",Q,x(e.fixedFieldVal),1)):(o(),i(m,{key:1},[e.fieldType==="input"?(o(),p(w,{key:0,modelValue:d[e.fieldValue],"onUpdate:modelValue":l=>d[e.fieldValue]=l},null,8,["modelValue","onUpdate:modelValue"])):u("v-if",!0),e.fieldType==="radio"?(o(),p(y,{key:1,onChange:l=>U(l,d,e),modelValue:d[e.fieldValue],"onUpdate:modelValue":l=>d[e.fieldValue]=l,placeholder:"\u8BF7\u9009\u62E9"},{default:r(()=>[(o(!0),i(m,null,_(e.selectValues.split(","),(l,k)=>(o(),p(f,{label:l,value:l,key:l+k},null,8,["label","value"]))),128))]),_:2},1032,["onChange","modelValue","onUpdate:modelValue"])):u("v-if",!0),e.fieldType==="checkbox"?(o(),p(y,{key:2,onChange:l=>O(l,d,e),multiple:"",modelValue:d[e.fieldValue],"onUpdate:modelValue":l=>d[e.fieldValue]=l,placeholder:"\u8BF7\u9009\u62E9"},{default:r(()=>[(o(!0),i(m,null,_(e.selectValues.split(","),(l,k)=>(o(),p(f,{label:l,value:l,key:l+k},null,8,["label","value"]))),128))]),_:2},1032,["onChange","modelValue","onUpdate:modelValue"])):u("v-if",!0),e.fieldType==="time_second"?(o(),p(H,{key:3,modelValue:d[e.fieldValue],"onUpdate:modelValue":l=>d[e.fieldValue]=l,type:"datetime","value-format":"YYYY-MM-DD HH:mm:ss",placeholder:""},null,8,["modelValue","onUpdate:modelValue"])):u("v-if",!0),e.fieldType==="number"?(o(),p(L,{key:4,modelValue:d[e.fieldValue],"onUpdate:modelValue":l=>d[e.fieldValue]=l,placeholder:""},null,8,["modelValue","onUpdate:modelValue"])):u("v-if",!0)],64))],64)):(o(),i(m,{key:1},[u(" <template></template> "),V("div",null,x(d[e.fieldValue]),1)],64))]),_:2},1032,["prop","label","min-width"]))),128)),n.isAllEditMode?u("v-if",!0):(o(),i(m,{key:0},[c(a,{prop:"creatorOrganUnitIdCn",label:"\u586B\u62A5\u5355\u4F4D"}),c(a,{prop:"creator",label:"\u586B\u62A5\u4EBA"}),c(a,{prop:"createTime",label:"\u586B\u62A5\u65F6\u95F4"},{default:r(({row:e})=>[$(x(e.createTime?E(S)(e.createTime).format("YYYY-MM-DD HH:mm:ss"):""),1)]),_:1})],64)),n.isAllEditMode?(o(),p(a,{key:1,label:"\u64CD\u4F5C","min-width":"200px",fixed:"right"},{default:r(({row:e})=>[u('  :disabled="tableData.length === 1" '),c(A,{type:"danger",link:"",onClick:d=>N(e)},{default:r(()=>t[0]||(t[0]=[$("\u5220\u9664")])),_:2},1032,["onClick"])]),_:1})):u("v-if",!0)]),_:1},8,["data"]),n.isAllEditMode?(o(),i("div",W,[c(A,{type:"primary",icon:E(z),onClick:q},{default:r(()=>t[2]||(t[2]=[$(" \u65B0\u589E ")])),_:1},8,["icon"])])):u("v-if",!0)]),u(` <el-table-column prop="date" label="Date" min-width="200px">
		<template #default="{ row, column }">
			<div>
				<el-date-picker
					:key="\`\${row.id}-\${column.no}\`"
					v-if="isEditing(row.id, column.no)"
					:ref="el => (inputRefs[\`\${row.id}-\${column.no}\`] = el)"
					@blur="handleBlur(row, column)"
					v-model="row.date"
					type="date"
					placeholder="\u9009\u62E9\u65E5\u671F"
					format="YYYY-MM-DD"
					value-format="YYYY-MM-DD"
				/>
				<span v-else>{{ row.date }}</span>
			</div>
		</template>
	</el-table-column>
	<el-table-column prop="name" label="Name" min-width="200px">
		<template>
			<div style="width: 100%; height: 100%">
				<div
					style="width: 100%; height: 500px; position: absolute; background-color: pink; top: 0; left: 0; z-index: 100000"
				></div>
			</div>
		</template>
	</el-table-column>
	<el-table-column prop="address" label="Address" min-width="200p x">
		<template #default="{ row, column }">
			<div>
				<el-input
					:key="\`\${row.id}-\${column.no}\`"
					v-if="isEditing(row.id, column.no)"
					:ref="el => (inputRefs[\`\${row.id}-\${column.no}\`] = el)"
					@blur="handleBlur(row, column)"
					@keyup.enter="blurValueInput(row, column)"
					v-model="row.address"
				/>
				<span v-else>{{ row.address }}</span>
			</div>
		</template>
	</el-table-column>
	<el-table-column prop="value" label="Value" min-width="200px">
		<template #default="{ row, column }">
			<div>
				<el-input
					:key="\`\${row.id}-\${column.no}\`"
					v-if="isEditing(row.id, column.no)"
					:ref="el => (inputRefs[\`\${row.id}-\${column.no}\`] = el)"
					@blur="handleBlur(row, column)"
					@keyup.enter="blurValueInput(row, column)"
					v-model="row.value"
				/>
				<span v-else>{{ row.value }}</span>
			</div>
		</template>
	</el-table-column>
	<el-table-column prop="age" label="Age" min-width="120px">
		<template #default="{ row, column }">
			<div>
				<el-input
					:key="\`\${row.id}-\${column.no}\`"
					v-if="isEditing(row.id, column.no)"
					:ref="el => (inputRefs[\`\${row.id}-\${column.no}\`] = el)"
					@blur="handleBlur(row, column)"
					@keyup.enter="blurValueInput(row, column)"
					v-model="row.age"
				/>
				<span v-else>{{ row.age }}</span>
			</div>
		</template>
	</el-table-column>
	<el-table-column prop="email" label="Email" min-width="200px">
		<template #default="{ row, column }">
			<div>
				<el-select
					:key="\`\${row.id}-\${column.no}\`"
					v-if="isEditing(row.id, column.no)"
					:ref="el => (inputRefs[\`\${row.id}-\${column.no}\`] = el)"
					@blur="handleBlur(row, column)"
					v-model="row.email"
					placeholder="\u8BF7\u9009\u62E9\u90AE\u7BB1"
				>
					<el-option v-for="item in emailOptions" :key="item.value" :label="item.label" :value="item.value" />
				</el-select>
				<span v-else>{{ row.email }}</span>
			</div>
		</template>
	</el-table-column>
	<el-table-column prop="phone" label="Phone" min-width="160px">
		<template #default="{ row, column }">
			<div>
				<el-input
					:key="\`\${row.id}-\${column.no}\`"
					v-if="isEditing(row.id, column.no)"
					:ref="el => (inputRefs[\`\${row.id}-\${column.no}\`] = el)"
					@blur="handleBlur(row, column)"
					@keyup.enter="blurValueInput(row, column)"
					v-model="row.phone"
				/>
				<span v-else>{{ row.phone }}</span>
			</div>
		</template>
	</el-table-column>
	<el-table-column prop="company" label="Company" min-width="180px">
		<template #default="{ row, column }">
			<div>
				<el-input
					:key="\`\${row.id}-\${column.no}\`"
					v-if="isEditing(row.id, column.no)"
					:ref="el => (inputRefs[\`\${row.id}-\${column.no}\`] = el)"
					@blur="handleBlur(row, column)"
					@keyup.enter="blurValueInput(row, column)"
					v-model="row.company"
				/>
				<span v-else>{{ row.company }}</span>
			</div>
		</template>
	</el-table-column>
	<el-table-column prop="remark" label="Remark" min-width="200px">
		<template #default="{ row, column }">
			<div>
				<el-input
					:key="\`\${row.id}-\${column.no}\`"
					v-if="isEditing(row.id, column.no)"
					:ref="el => (inputRefs[\`\${row.id}-\${column.no}\`] = el)"
					@blur="handleBlur(row, column)"
					@keyup.enter="blurValueInput(row, column)"
					v-model="row.remark"
				/>
				<span v-else>{{ row.remark }}</span>
			</div>
		</template>
	</el-table-column>
	<el-table-column label="Operate" min-width="200px">
		<template #default="{ row }">
			<el-button type="danger" link @click="handleDelete(row)">Delete</el-button>
		</template>
	</el-table-column> `),u(' <el-switch v-model="isAllEditMode" active-text="\u5168\u90E8\u7F16\u8F91" inactive-text="\u666E\u901A\u6A21\u5F0F" @change="handleEditModeChange" /> ')],64)}}});const ne=J(X,[["__scopeId","data-v-9679acc4"]]);export{ne as default};
