|
@@ -4,14 +4,14 @@ import { ElMessageBox } from "element-plus";
|
|
* @Author: Gui
|
|
* @Author: Gui
|
|
* @Date: 2023-10-10 11:13:51
|
|
* @Date: 2023-10-10 11:13:51
|
|
* @LastEditors: guicheng 1625811865@qq.com
|
|
* @LastEditors: guicheng 1625811865@qq.com
|
|
- * @LastEditTime: 2024-09-30 18:07:52
|
|
|
|
|
|
+ * @LastEditTime: 2024-10-08 14:54:02
|
|
* @Description: kxs files
|
|
* @Description: kxs files
|
|
* @filePath:
|
|
* @filePath:
|
|
*/
|
|
*/
|
|
export const tableSelect = (option) => {
|
|
export const tableSelect = (option) => {
|
|
- let lastSelectValue = option.scope.row[option.mode]
|
|
|
|
|
|
+ let lastSelectValue = option.scope.row[option.fields]
|
|
const sexChange = ({ row }, show) => {
|
|
const sexChange = ({ row }, show) => {
|
|
- option.list.value[option.list.value.findIndex(item => row.id == item.id)].isSelectChange = show;
|
|
|
|
|
|
+ option.dataList.value[option.dataList.value.findIndex(item => row.id == item.id)].isSelectChange = show;
|
|
}
|
|
}
|
|
return <div>
|
|
return <div>
|
|
{
|
|
{
|
|
@@ -19,10 +19,10 @@ export const tableSelect = (option) => {
|
|
<el-select
|
|
<el-select
|
|
class="!w-[100px]"
|
|
class="!w-[100px]"
|
|
size="small"
|
|
size="small"
|
|
- v-model={option.scope.row[option.mode]}
|
|
|
|
|
|
+ v-model={option.scope.row[option.fields]}
|
|
placeholder="请选择修改项"
|
|
placeholder="请选择修改项"
|
|
onChange={() => {
|
|
onChange={() => {
|
|
- option.tips ?
|
|
|
|
|
|
+ option.isTip ?
|
|
ElMessageBox.confirm(
|
|
ElMessageBox.confirm(
|
|
`是否调整当前属性? `,
|
|
`是否调整当前属性? `,
|
|
"提示",
|
|
"提示",
|
|
@@ -32,16 +32,16 @@ export const tableSelect = (option) => {
|
|
type: "warning"
|
|
type: "warning"
|
|
}
|
|
}
|
|
).then(async () => {
|
|
).then(async () => {
|
|
- lastSelectValue = option.scope.row[option.mode];
|
|
|
|
|
|
+ lastSelectValue = option.scope.row[option.fields];
|
|
sexChange(option.scope as any, false)
|
|
sexChange(option.scope as any, false)
|
|
option.callback(option.scope as any)
|
|
option.callback(option.scope as any)
|
|
}).catch(() => {
|
|
}).catch(() => {
|
|
- option.scope.row[option.mode] = lastSelectValue;
|
|
|
|
|
|
+ option.scope.row[option.fields] = lastSelectValue;
|
|
sexChange(option.scope as any, false)
|
|
sexChange(option.scope as any, false)
|
|
- }) : () => {
|
|
|
|
|
|
+ }) : (() => {
|
|
sexChange(option.scope as any, false);
|
|
sexChange(option.scope as any, false);
|
|
option.callback(option.scope as any)
|
|
option.callback(option.scope as any)
|
|
- };
|
|
|
|
|
|
+ })();
|
|
}}
|
|
}}
|
|
>
|
|
>
|
|
{option.mapList.map((item: any) => (
|
|
{option.mapList.map((item: any) => (
|
|
@@ -51,11 +51,11 @@ export const tableSelect = (option) => {
|
|
:
|
|
:
|
|
<el-tag
|
|
<el-tag
|
|
size={option.scope.props.size}
|
|
size={option.scope.props.size}
|
|
- type={option.mapList.find(item => item.id === option.scope.row[option.mode])?.type}
|
|
|
|
- effect={option.mapList.find(item => item.id === option.scope.row[option.mode])?.effect}
|
|
|
|
|
|
+ type={option.mapList.find(item => item.id === option.scope.row[option.fields])?.type}
|
|
|
|
+ effect={option.mapList.find(item => item.id === option.scope.row[option.fields])?.effect}
|
|
onClick={() =>sexChange(option.scope as any, true)}
|
|
onClick={() =>sexChange(option.scope as any, true)}
|
|
>
|
|
>
|
|
- {option.mapList.find(item => item.id === option.scope.row[option.mode])?.label}
|
|
|
|
|
|
+ {option.mapList.find(item => item.id === option.scope.row[option.fields])?.label}
|
|
</el-tag>
|
|
</el-tag>
|
|
}
|
|
}
|
|
</div>
|
|
</div>
|