- function generateMixed(n) {
- var chars = ["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c", "d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y", "z"];
- var res = "";
- for (var i = 0; i < n; i++) {
- var id = Math.floor(Math.random() * 62);
- res += chars[id];
- }
- return res;
- }
- //获取当前页面
- var page = Forguncy.Page;
- //获取当前页面上名称为myCell的单元格
- var textCell = page.getCell("myCell");
- //设置指定单元格的值
- textCell.setValue(generateMixed(10));//取10位随机大小写加数字
复制代码
编辑框名称设置为 myCell
执行JS命令
|