🐛 修复隐藏排序问题 #317
This commit is contained in:
parent
3c1e30182f
commit
14baa176d9
@ -1,7 +1,7 @@
|
|||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const JSZip = require("jszip");
|
const JSZip = require("jszip");
|
||||||
const ChromeExtension = require("crx");
|
const ChromeExtension = require("crx");
|
||||||
const { execSync, exec } = require("child_process");
|
const { execSync } = require("child_process");
|
||||||
const semver = require("semver");
|
const semver = require("semver");
|
||||||
const manifest = require("../src/manifest.json");
|
const manifest = require("../src/manifest.json");
|
||||||
const package = require("../package.json");
|
const package = require("../package.json");
|
||||||
@ -47,8 +47,6 @@ if (process.env.GITHUB_REF_TYPE === "branch") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
execSync("npm run build", { stdio: "inherit" });
|
execSync("npm run build", { stdio: "inherit" });
|
||||||
// 再打包分割的文件
|
|
||||||
// execSync("npm run build:split", { stdio: "inherit" });
|
|
||||||
|
|
||||||
// 处理firefox和chrome的zip压缩包
|
// 处理firefox和chrome的zip压缩包
|
||||||
|
|
||||||
|
@ -615,6 +615,7 @@ function ScriptList() {
|
|||||||
const dealColumns: ColumnProps[] = [];
|
const dealColumns: ColumnProps[] = [];
|
||||||
|
|
||||||
newColumns.forEach((item) => {
|
newColumns.forEach((item) => {
|
||||||
|
console.log(newColumns);
|
||||||
switch (item.width) {
|
switch (item.width) {
|
||||||
case -1:
|
case -1:
|
||||||
break;
|
break;
|
||||||
@ -625,37 +626,39 @@ function ScriptList() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const sortIndex = dealColumns.findIndex((item) => item.key === "sort");
|
const sortIndex = dealColumns.findIndex((item) => item.key === "sort");
|
||||||
|
let SortableItem;
|
||||||
|
if (sortIndex !== -1) {
|
||||||
|
SortableItem = (props: any) => {
|
||||||
|
const { attributes, listeners, setNodeRef, transform, transition } = useSortable({ id: props!.record.uuid });
|
||||||
|
|
||||||
const SortableItem = (props: any) => {
|
const style = {
|
||||||
const { attributes, listeners, setNodeRef, transform, transition } = useSortable({ id: props!.record.uuid });
|
transform: CSS.Transform.toString(transform),
|
||||||
|
transition,
|
||||||
|
};
|
||||||
|
|
||||||
const style = {
|
// 替换排序列,使其可以拖拽
|
||||||
transform: CSS.Transform.toString(transform),
|
props.children[sortIndex + 1] = (
|
||||||
transition,
|
<td
|
||||||
|
className="arco-table-td"
|
||||||
|
style={{
|
||||||
|
textAlign: "center",
|
||||||
|
}}
|
||||||
|
key="drag"
|
||||||
|
>
|
||||||
|
<div className="arco-table-cell">
|
||||||
|
<IconMenu
|
||||||
|
style={{
|
||||||
|
cursor: "move",
|
||||||
|
}}
|
||||||
|
{...listeners}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
);
|
||||||
|
|
||||||
|
return <tr ref={setNodeRef} style={style} {...attributes} {...props} />;
|
||||||
};
|
};
|
||||||
|
}
|
||||||
// 替换排序列,使其可以拖拽
|
|
||||||
props.children[sortIndex + 1] = (
|
|
||||||
<td
|
|
||||||
className="arco-table-td"
|
|
||||||
style={{
|
|
||||||
textAlign: "center",
|
|
||||||
}}
|
|
||||||
key="drag"
|
|
||||||
>
|
|
||||||
<div className="arco-table-cell">
|
|
||||||
<IconMenu
|
|
||||||
style={{
|
|
||||||
cursor: "move",
|
|
||||||
}}
|
|
||||||
{...listeners}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
);
|
|
||||||
|
|
||||||
return <tr ref={setNodeRef} style={style} {...attributes} {...props} />;
|
|
||||||
};
|
|
||||||
|
|
||||||
const components: ComponentsProps = {
|
const components: ComponentsProps = {
|
||||||
table: React.forwardRef(SortableWrapper),
|
table: React.forwardRef(SortableWrapper),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user