var special_die_info = dataModel.getWorkValue("special_die_info_customize1") GUI.msgbox({detail:_.toString(special_die_info)}); if (!_.isEmpty(special_die_info)) { special_die_info = JSON.parse(special_die_info) Bridge_Die_Mount_Step_Quantity = _.map(special_die_info, 'die_fullname') Bridge_Die_Type_uantity = _.uniq(_.map(special_die_info, 'die_name')) //插入行 _.forEach(special_die_info, function (v) { excel.copyRows(4); excel.insertRow(4); }) excel.setRangeValue("E2", Bridge_Die_Mount_Step_Quantity.length); excel.setRangeValue("H2", Bridge_Die_Type_uantity.length); const EXPORT_KEYS = ["die_size_x_mm", "die_size_y_mm", "die_angle", "die_count", "cavity_size_x", "cavity_size_y"]; for (var stkIndex = 0; stkIndex < special_die_info.length; stkIndex++) { var dataMap = special_die_info[stkIndex]; for (var headerIndex = 0; headerIndex < EXPORT_KEYS.length; headerIndex++) { var row = stkIndex + 4; var col = headerIndex + 9; var cell = excel.getCell(row, col); var range = excel.getCellAddress(cell); excel.setRangeValue('C' + row, _.toString(dataMap['die_fullname'])); excel.setRangeValue('F' + row, _.toString(dataMap['die_name'])); excel.setRangeValue(range, _.toString(dataMap[EXPORT_KEYS[headerIndex]])); } } excel.deleteRows(4 + special_die_info.length); }
时间: 2024-04-05 11:34:12 浏览: 76
这段代码看起来是使用 JavaScript 语言编写的,它的作用是从一个名为 "special_die_info_customize1" 的数据模型中获取数据,并将其转换为 JSON 格式。如果获取到的数据不为空,它会对数据进行解析,并将特定的数据按照一定的格式插入到一个 Excel 表格中。同时,它还会删除插入的行,以保证表格的正确性。
相关问题
E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.hjschoolhelper210301201_1, PID: 2778 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.hjschoolhelper210301201_1/com.example.hjschoolhelper210301201_1.LoginMainActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3645) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3782) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2307) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7872) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936) Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. at androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor(AppCompatDelegateImpl.java:846) at androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:809) at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:696) at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:195) at com.example.hjschoolhelper210301201_1.LoginMainActivity.onCreate(LoginMainActivity.java:26) at android.app.Activity.performCreate(Activity.java:8305) at android.app.Activity.performCreate(Activity.java:8284) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1417) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3626) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3782) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2307) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7872) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
这个错误提示是因为你的 Activity 使用了不兼容的主题。具体地说,你需要使用一个继承自 Theme.AppCompat 主题的主题。你可以在你的 AndroidManifest.xml 文件中为该 Activity 添加一个主题,比如:
```xml
<activity
android:name=".LoginMainActivity"
android:theme="@style/Theme.AppCompat.Light">
```
或者你可以在你的 styles.xml 文件中定义一个主题,然后在 AndroidManifest.xml 文件中引用该主题,比如:
```xml
<style name="AppTheme" parent="Theme.AppCompat.Light">
<!-- Customize your theme here. -->
</style>
```
然后在 AndroidManifest.xml 文件中引用该主题:
```xml
<application
android:theme="@style/AppTheme">
<!-- ... -->
</application>
```
Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... error error: subprocess-exited-with-error × Preparing metadata (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [134 lines of output] lapack_opt_info: lapack_mkl_info: customize UnixCCompiler libraries mkl_rt not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/arm-linux-gnueabihf'] NOT AVAILABLE
根据你提供的信息,这似乎是在安装Python包时出现的错误。出现这种错误可能是因为缺少某些依赖项。你可以尝试以下步骤来解决这个问题:
1. 确认你已经安装了正确版本的Python。
2. 确认你已经安装了所有必需的依赖项,例如lapack和mkl_rt库,可以使用以下命令安装:
```
sudo apt-get install liblapack-dev
sudo apt-get install libopenblas-dev
```
3. 确认你已经安装了正确版本的pip和setuptools,可以使用以下命令更新它们:
```
pip install --upgrade pip setuptools
```
4. 重新安装你想要安装的Python包。
如果上述步骤均无法解决你遇到的问题,你可以尝试在安装包之前升级你的操作系统和相关软件包。
阅读全文