Browse Source

添加数据源并打包

yangg 8 months ago
parent
commit
91e025ec9c

+ 1 - 1
.env.development

@@ -2,5 +2,5 @@
 ENV = 'development'
 ENV = 'development'
 port = 8080
 port = 8080
 # base api
 # base api
-VUE_APP_BASE_API = 'http://192.168.1.199:8084'
+VUE_APP_BASE_API = 'http://183.195.216.54:8084'
 #192.168.1.200
 #192.168.1.200

File diff suppressed because it is too large
+ 0 - 0
dist/index.html


+ 0 - 0
dist/static/css/chunk-7dfdc0a0.50fc024e.css → dist/static/css/chunk-103ca571.50fc024e.css


+ 0 - 0
dist/static/css/chunk-279c9a9f.641e9b71.css → dist/static/css/chunk-254ac533.641e9b71.css


+ 1 - 0
dist/static/css/chunk-3b439d41.d0f023e2.css

@@ -0,0 +1 @@
+.gpu-list[data-v-e72d6cca]{padding:20px}.filter-section[data-v-e72d6cca]{margin-bottom:20px}.ml-15[data-v-e72d6cca]{margin-left:15px}.pagination[data-v-e72d6cca]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;margin-top:15px}

+ 0 - 1
dist/static/css/chunk-494a0c21.78080182.css

@@ -1 +0,0 @@
-.gpu-list[data-v-b3bed7a4]{padding:20px}.filter-section[data-v-b3bed7a4]{margin-bottom:20px}.ml-15[data-v-b3bed7a4]{margin-left:15px}.pagination[data-v-b3bed7a4]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;margin-top:15px}

+ 0 - 0
dist/static/css/chunk-3f426cd0.d1f21e34.css → dist/static/css/chunk-6111b966.d1f21e34.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/chunk-6ff59d76.5e1eb2f5.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.d4ffd787.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-103ca571.9be9d3e9.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-254ac533.8b4d0534.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-279c9a9f.fffdcc7a.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-3b439d41.136103de.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-3f426cd0.fb11fc95.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-494a0c21.ec505796.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-6111b966.b3c9e2d0.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-6ff59d76.f8ec8c85.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-7dbc1954.7f7e5a40.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-7dfdc0a0.a33b1d95.js


+ 57 - 40
src/views/dataCenter/components/dataInfo.vue

@@ -1,9 +1,17 @@
 <template>
 <template>
-  <div class="data-info">
+  <div
+    class="data-info"
+    v-loading="isLoading"
+    element-loading-text="Excel文件加载中..."
+  >
     <el-card>
     <el-card>
       <el-form :model="dataForm" label-width="120px">
       <el-form :model="dataForm" label-width="120px">
         <el-form-item label="数据表编码:">
         <el-form-item label="数据表编码:">
-          <el-input v-model="dataForm.code"  style="width: 30%;"  placeholder="请输入数据表编码"></el-input>
+          <el-input
+            v-model="dataForm.code"
+            style="width: 30%"
+            placeholder="请输入数据表编码"
+          ></el-input>
         </el-form-item>
         </el-form-item>
         <el-form-item label="所属分类:">
         <el-form-item label="所属分类:">
           <el-select
           <el-select
@@ -22,7 +30,11 @@
           </el-select>
           </el-select>
         </el-form-item>
         </el-form-item>
         <el-form-item label="数据表名称:">
         <el-form-item label="数据表名称:">
-          <el-input v-model="dataForm.name" style="width: 30%;" placeholder="请输入数据表名称"></el-input>
+          <el-input
+            v-model="dataForm.name"
+            style="width: 30%"
+            placeholder="请输入数据表名称"
+          ></el-input>
         </el-form-item>
         </el-form-item>
         <el-form-item label="选择文件:">
         <el-form-item label="选择文件:">
           <el-upload
           <el-upload
@@ -105,6 +117,7 @@ export default {
   data() {
   data() {
     return {
     return {
       isMaskShow: false,
       isMaskShow: false,
+      isLoading: false,
       dataForm: {
       dataForm: {
         id: 0,
         id: 0,
         code: "",
         code: "",
@@ -141,18 +154,17 @@ export default {
   methods: {
   methods: {
     initCategory() {
     initCategory() {
       let _this = this;
       let _this = this;
-      searchSourceDataCategory({ page: 1, pageSize: 9999 }).then(
-        (res) => {
-          if (res.status != 200) return;
-          _this.categoryList = res.data.sourcecategories.map((res) => {
-            return {
-              id: res.id,
-              value: res.id,
-              name: res.name,
-            };
-          });
-        }
-      );
+
+      searchSourceDataCategory({ page: 1, pageSize: 9999 }).then((res) => {
+        if (res.status != 200) return;
+        _this.categoryList = res.data.sourcecategories.map((res) => {
+          return {
+            id: res.id,
+            value: res.id,
+            name: res.name,
+          };
+        });
+      });
     },
     },
 
 
     loadData(id) {
     loadData(id) {
@@ -160,34 +172,39 @@ export default {
       let par = {
       let par = {
         id: id,
         id: id,
       };
       };
-      getSourceData(par).then((res) => {
-        if (res.status != 200) {
-          this.dataForm.id = 0;
-          return;
-        }
-        _this.dataForm = res.data;
-        _this.dataForm.sourceData = JSON.parse(_this.dataForm.source_data);
-        if (res.data.category && res.data.category.id) {
-          _this.dataForm.category_id = res.data.category.category_id;
-        }
+      _this.isLoading = true;
+      getSourceData(par)
+        .then((res) => {
+          if (res.status != 200) {
+            this.dataForm.id = 0;
+            return;
+          }
+          _this.dataForm = res.data;
+          _this.dataForm.sourceData = JSON.parse(_this.dataForm.source_data);
+          if (res.data.category && res.data.category.id) {
+            _this.dataForm.category_id = res.data.category.category_id;
+          }
 
 
-        _this.fileLoadStatus = true;
-        _this.$nextTick(() => {
-          luckysheet.destroy();
-          luckysheet.create({
-            container: "luckysheet", //dom id
-            data: _this.dataForm.sourceData.exportJson.sheets, //excel数据
-            lang: "zh",
-            hook: {
-              cellUpdated: function (r, c, oldValue, newValue, isRefresh) {
-                // console.log("oldVal",oldValue);
-                // console.log("newVal",newValue);
-                //   console.log('exportJson',_this.dataForm.source_data.exportJson)
+          _this.fileLoadStatus = true;
+          _this.$nextTick(() => {
+            luckysheet.destroy();
+            luckysheet.create({
+              container: "luckysheet", //dom id
+              data: _this.dataForm.sourceData.exportJson.sheets, //excel数据
+              lang: "zh",
+              hook: {
+                cellUpdated: function (r, c, oldValue, newValue, isRefresh) {
+                  // console.log("oldVal",oldValue);
+                  // console.log("newVal",newValue);
+                  //   console.log('exportJson',_this.dataForm.source_data.exportJson)
+                },
               },
               },
-            },
+            });
           });
           });
+        })
+        .finally(() => {
+          _this.isLoading = false; // 结束加载
         });
         });
-      });
     },
     },
 
 
     btnSave(e) {
     btnSave(e) {
@@ -253,7 +270,7 @@ export default {
       _this.fileLoadStatus = false;
       _this.fileLoadStatus = false;
       if (
       if (
         e.type ===
         e.type ===
-          "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
+        "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
       ) {
       ) {
         _this.fileLoadStatus = true;
         _this.fileLoadStatus = true;
         _this.fileList = [e];
         _this.fileList = [e];

+ 129 - 99
src/views/dataCenter/dataView.vue

@@ -1,111 +1,146 @@
 <template>
 <template>
-  <div class="com-data-view">
-    <div id="luckysheet" ref='luckysheet' style="margin:0px;padding:0px;position:absolute;width:100%;height:100%;left: 0px;top:0px;bottom:0px;">
+  <div
+    class="com-data-view"
+    v-loading="isInitShow"
+    element-loading-text="加载中..."
+  >
+    <div
+      id="luckysheet"
+      ref="luckysheet"
+      style="
+        margin: 0px;
+        padding: 0px;
+        position: absolute;
+        width: 100%;
+        height: 100%;
+        left: 0px;
+        top: 0px;
+        bottom: 0px;
+      "
+    ></div>
+
+    <div
+      v-show="isMaskShow"
+      style="
+        position: absolute;
+        z-index: 1000000;
+        left: 0px;
+        top: 0px;
+        bottom: 0px;
+        right: 0px;
+        background: rgba(255, 255, 255, 0.8);
+        text-align: center;
+        font-size: 40px;
+        align-items: center;
+        justify-content: center;
+        display: flex;
+      "
+    >
+      下载中
     </div>
     </div>
 
 
-
-    <div v-show="isMaskShow"
-      style="position: absolute;z-index: 1000000;left: 0px;top: 0px;bottom: 0px;right: 0px; background: rgba(255, 255, 255, 0.8); text-align: center;font-size: 40px;align-items:center;justify-content: center;display:flex;">
-      下载中</div>
-
     <div class="btn-save">
     <div class="btn-save">
-    <!--     <el-button type="primary" @click="onSave">保存修改</el-button> -->
+      <!--     <el-button type="primary" @click="onSave">保存修改</el-button> -->
     </div>
     </div>
   </div>
   </div>
 </template>
 </template>
 
 
 
 
 <script>
 <script>
-  import LuckyExcel from 'luckyexcel'
-  import {getSourceData} from "@/api/sourceData";
-  export default {
-    data() {
-      return {
-        isMaskShow: false,
-        dataForm:{
-          id:0,
-          code:'',
-          name:'',
-          sourceData:{
-            exportJson:null,
-            luckysheetfile:''
-          },
-          status:'',
+import LuckyExcel from "luckyexcel";
+import { getSourceData } from "@/api/sourceData";
+export default {
+  data() {
+    return {
+      isMaskShow: false,
+      isInitShow: false,
+      dataForm: {
+        id: 0,
+        code: "",
+        name: "",
+        sourceData: {
+          exportJson: null,
+          luckysheetfile: "",
         },
         },
-      }
-    },
-    // mounted生命周期
-    mounted() {
-      // this.initSheet();
-      let id=this.$route.query.id;
-      this.loadSourceData(id);
-    },
-    // methods方法
-    methods: {
-
-      loadSourceData(id){
-        let _this=this;
-        getSourceData({id:id}).then(res=>{
-          if(res.status!=200)return;
-         _this.dataForm=res.data;
-         _this.dataForm.sourceData=JSON.parse(_this.dataForm.source_data);
-         _this.fileLoadStatus=true;
-
-         _this.$nextTick(() => {
-
-           luckysheet.destroy();
-           luckysheet.create({
-             container: 'luckysheet', //dom id
-             data: _this.dataForm.sourceData.exportJson.sheets, //excel数据
-             lang: 'zh',
-             allowEdit: false, // 是否允许前台编辑
-             hook:{
-               cellUpdated: function (r, c, oldValue, newValue, isRefresh) {
-                 console.log("r",r);
-                 console.log("c",c);
-                 // console.log("oldVal",oldValue);
-                 // console.log("newVal",newValue);
-                 //   console.log('exportJson',_this.dataForm.source_data.exportJson)
-               },
-             },
-           });
-
-
-         });
-
-        })
-      },
-
-      onSave(e){
-         // 导出Excel文件
-         console.log(this.$refs.luckysheet);
+        status: "",
       },
       },
+    };
+  },
+  // mounted生命周期
+  mounted() {
+    // this.initSheet();
+    let id = this.$route.query.id;
+    this.loadSourceData(id);
+  },
+  // methods方法
+  methods: {
+    loadSourceData(id) {
+      let _this = this;
+      _this.isInitShow = true;
+      getSourceData({ id: id })
+        .then((res) => {
+          if (res.status != 200) return;
+          _this.dataForm = res.data;
+          _this.dataForm.sourceData = JSON.parse(_this.dataForm.source_data);
+          _this.fileLoadStatus = true;
+
+          _this.$nextTick(() => {
+            luckysheet.destroy();
+            luckysheet.create({
+              container: "luckysheet", //dom id
+              data: _this.dataForm.sourceData.exportJson.sheets, //excel数据
+              lang: "zh",
+              allowEdit: false, // 是否允许前台编辑
+              hook: {
+                cellUpdated: function (r, c, oldValue, newValue, isRefresh) {
+                  console.log("r", r);
+                  console.log("c", c);
+                  // console.log("oldVal",oldValue);
+                  // console.log("newVal",newValue);
+                  //   console.log('exportJson',_this.dataForm.source_data.exportJson)
+                },
+              },
+            });
+          });
+        })
+        .finally(() => {
+          _this.isInitShow = false; // 结束加载
+        });
+    },
 
 
+    onSave(e) {
+      // 导出Excel文件
+      console.log(this.$refs.luckysheet);
+    },
 
 
-      //加载excel文件
-      loadExcel(fileObj) {
-        if (fileObj == null) {
-          this.$alert("请选择正确的文件");
-          return;
-        }
-        const value = fileObj.url;
-        const name = fileObj.name;
-        this.isMaskShow = true;
-        LuckyExcel.transformExcelToLuckyByUrl(value, name, (exportJson, luckysheetfile) => {
+    //加载excel文件
+    loadExcel(fileObj) {
+      if (fileObj == null) {
+        this.$alert("请选择正确的文件");
+        return;
+      }
+      const value = fileObj.url;
+      const name = fileObj.name;
+      this.isMaskShow = true;
+      LuckyExcel.transformExcelToLuckyByUrl(
+        value,
+        name,
+        (exportJson, luckysheetfile) => {
           if (exportJson.sheets == null || exportJson.sheets.length == 0) {
           if (exportJson.sheets == null || exportJson.sheets.length == 0) {
-              alert("Failed to read the content of the excel file, currently does not support xls files!");
-              return;
+            alert(
+              "Failed to read the content of the excel file, currently does not support xls files!"
+            );
+            return;
           }
           }
 
 
-
           this.isMaskShow = false;
           this.isMaskShow = false;
           window.luckysheet.destroy();
           window.luckysheet.destroy();
           window.luckysheet.create({
           window.luckysheet.create({
-            container: 'luckysheet', //luckysheet is the container id
-             data: exportJson.sheets,
+            container: "luckysheet", //luckysheet is the container id
+            data: exportJson.sheets,
             title: exportJson.info.name,
             title: exportJson.info.name,
             userInfo: exportJson.info.name.creator,
             userInfo: exportJson.info.name.creator,
-             lang: 'zh',
+            lang: "zh",
             showinfobar: false, // 是否显示顶部信息栏
             showinfobar: false, // 是否显示顶部信息栏
             showstatisticBar: true, // 是否显示底部计数栏
             showstatisticBar: true, // 是否显示底部计数栏
             sheetBottomConfig: true, // sheet页下方的添加行按钮和回到顶部按钮配置
             sheetBottomConfig: true, // sheet页下方的添加行按钮和回到顶部按钮配置
@@ -115,26 +150,21 @@
             sheetFormulaBar: false, // 是否显示公式栏
             sheetFormulaBar: false, // 是否显示公式栏
             enableAddBackTop: false, // 返回头部按钮
             enableAddBackTop: false, // 返回头部按钮
             showsheetbar: false, // 是否显示底部sheet页按钮
             showsheetbar: false, // 是否显示底部sheet页按钮
-            enableAddRow: false,//允许添加行
+            enableAddRow: false, //允许添加行
             // 自定义配置底部sheet页按钮
             // 自定义配置底部sheet页按钮
-            events:{
-            },
+            events: {},
             showsheetbarConfig: {
             showsheetbarConfig: {
               add: false,
               add: false,
               menu: false,
               menu: false,
             },
             },
           });
           });
-
-        });
-
-
-
-
-      },
-    }
-  }
+        }
+      );
+    },
+  },
+};
 </script>
 </script>
 
 
 <style lang="scss">
 <style lang="scss">
-  @import "./dataView.scss"
+@import "./dataView.scss";
 </style>
 </style>

+ 2 - 2
src/views/document/com/components/Formula/dataInfo.vue

@@ -14,9 +14,9 @@
             ref="formulaInput"
             ref="formulaInput"
           ></el-input>
           ></el-input>
           <div style="display: flex; justify-content: flex-end">
           <div style="display: flex; justify-content: flex-end">
-            <!-- <el-button style="margin-top: 10px" @click="InsertTableData"
+            <el-button style="margin-top: 10px" @click="InsertTableData"
               >插入表格数据</el-button
               >插入表格数据</el-button
-            > -->
+            >
             <el-button
             <el-button
               style="margin-top: 10px"
               style="margin-top: 10px"
               type="primary"
               type="primary"

+ 157 - 151
src/views/document/com/components/SourceData/index.vue

@@ -1,167 +1,173 @@
 <template>
 <template>
-  <div class="com-formual">
-        <el-form  >
-            <el-form-item >
-
-              <el-select v-model="tableCode"  placeholder="请选择状态" @change="onChangeTab" size="large" style="width:100%;">
-                    <el-option
-                      v-for="(item,index) in tableList"
-                      :key="item.id"
-                      :label="item.name"
-                      :value="index"
-                    />
-                  </el-select>
-
-            </el-form-item>
-            <el-form-item   style="min-height:500px;" v-if="fileLoadStatus">
-              <div id="luckysheet" ref="luckysheet" style="width:100%;height:500px;"> </div>
-            </el-form-item>
-
-          </el-form>
-
-          <el-dialog
-              :visible.sync="showConfirm"
-              :close-on-click-modal="false"
-              title="数据确认"
-              width="500"
-              align-center
-              :append-to-body="true"
-            >
-              <div>当前工作表:{{position.sheet}} </div>
-              <!-- <div>当前选择的位置:ROW:{{position.r}}, COL:{{position.c}} </div> -->
-              <div>当前取值:{{position.value}}</div>
-              <template #footer>
-                <div class="dialog-footer">
-                  <el-button @click="showConfirm = false">关闭</el-button>
-                  <el-button type="primary" @click="onConfirm">
-                    确认选择
-                  </el-button>
-                </div>
-              </template>
-            </el-dialog>
-
-
-
+  <div
+    class="com-formual"
+    v-loading="loading"
+    element-loading-text="数据加载中..."
+  >
+    <el-form>
+      <el-form-item>
+        <el-select
+          v-model="tableCode"
+          placeholder="请选择数据表"
+          @change="onChangeTab"
+          size="large"
+          style="width: 100%"
+        >
+          <el-option
+            v-for="(item, index) in tableList"
+            :key="item.id"
+            :label="item.name"
+            :value="index"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item style="min-height: 500px" v-if="fileLoadStatus">
+        <div
+          id="luckysheet"
+          ref="luckysheet"
+          style="width: 100%; height: 500px"
+        ></div>
+      </el-form-item>
+    </el-form>
+
+    <el-dialog
+      :visible.sync="showConfirm"
+      :close-on-click-modal="false"
+      title="数据确认"
+      width="500"
+      align-center
+      :append-to-body="true"
+    >
+      <div>当前工作表:{{ position.sheet }}</div>
+      <!-- <div>当前选择的位置:ROW:{{position.r}}, COL:{{position.c}} </div> -->
+      <div>当前取值:{{ position.value }}</div>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button @click="showConfirm = false">关闭</el-button>
+          <el-button type="primary" @click="onConfirm"> 确认选择 </el-button>
+        </div>
+      </template>
+    </el-dialog>
   </div>
   </div>
 </template>
 </template>
 
 
 <script>
 <script>
-
-  import{searchSourceData,deleteSourceData} from'@/api/sourceData';
-  import LuckyExcel from 'luckyexcel'; //引入LuckyExcel
-
-
-  export default{
-    name:"SourceData",
-    emits:['onPicked'],
-
-    components:{
-
-    },
-    data(){
-      return{
-          tableCode:'',
-          tableList:[],
-          showConfirm:false,
-          fileLoadStatus:false,
-          position:{
-            tb:'',
-            c:0,
-            r:0,
-            sheet:'',
-            value:''
-          }
-      }
-    },
-    mounted(){
-      this.initTableList();
-    },
-    methods:{
-
-      onConfirm(e){
-        this.showConfirm=false;
-        this.$emit("onPicked",this.position);
+import {
+  searchSourceData,
+  deleteSourceData,
+  getSourceData,
+} from "@/api/sourceData";
+import LuckyExcel from "luckyexcel"; //引入LuckyExcel
+
+export default {
+  name: "SourceData",
+  emits: ["onPicked"],
+
+  components: {},
+  data() {
+    return {
+      tableCode: "",
+      tableList: [],
+      showConfirm: false,
+      fileLoadStatus: false,
+      position: {
+        tb: "",
+        c: 0,
+        r: 0,
+        sheet: "",
+        value: "",
       },
       },
+      loading: false, // 添加 loading 状态控制
+    };
+  },
+  mounted() {
+    this.initTableList();
+  },
+  methods: {
+    onConfirm(e) {
+      this.showConfirm = false;
+      this.$emit("onPicked", this.position);
+    },
 
 
-      onChangeTab(e){
-        let _this=this;
-        let item=_this.tableList[e];
-        _this.fileLoadStatus=true;
-
-        item.sourceData=JSON.parse(item.source_data);
-
-
-
-        _this.position.tb=item.code;
-        _this.$nextTick(() => {
-          luckysheet.destroy();
-          luckysheet.create({
-            container: 'luckysheet', //dom id
-            data: item.sourceData.exportJson.sheets, //excel数据
-            lang: 'zh',
-            showinfobar: false, // 是否显示顶部信息栏
-            showstatisticBar: false, // 是否显示底部计数栏
-            sheetBottomConfig: false, // sheet页下方的添加行按钮和回到顶部按钮配置
-            allowEdit: false, // 是否允许前台编辑
-            enableAddRow: false, // 是否允许增加行
-            enableAddCol: false, // 是否允许增加列
-            sheetFormulaBar: false, // 是否显示公式栏
-            enableAddBackTop: false, // 返回头部按钮
-            showsheetbar: true, // 是否显示底部sheet页按钮
-            enableAddRow: false,//允许添加行
-            // 自定义配置底部sheet页按钮
-            showsheetbarConfig: {
-              add: false,
-              menu: false,
-            },
-            hook:{
-              cellMousedown: function (cell, position, sheetFile, ctx) {
-
-
-                _this.position.sheet=sheetFile.name;
-
-                _this.position.r=position.r;
-                _this.position.c=position.c;
-
-                if(cell.v){
-                  _this.position.value=cell.v;
-                }else{
-                  _this.position.value="";
-                  cell.ct.s.map(res=>{
-                    _this.position.value+=res.v;
-                  })
-                }
-                _this.showConfirm=true;
+    onChangeTab(e) {
+      let _this = this;
+      let item = _this.tableList[e];
+      _this.loading = true; // 开始加载
+      getSourceData({ id: item.id })
+        .then((res) => {
+          if (res.status !== 200) return;
+          _this.fileLoadStatus = true;
+
+          item.sourceData = JSON.parse(res.data.source_data);
+
+          _this.position.tb = item.code;
+          _this.$nextTick(() => {
+            luckysheet.destroy();
+            luckysheet.create({
+              container: "luckysheet", //dom id
+              data: item.sourceData.exportJson.sheets, //excel数据
+              lang: "zh",
+              showinfobar: false, // 是否显示顶部信息栏
+              showstatisticBar: false, // 是否显示底部计数栏
+              sheetBottomConfig: false, // sheet页下方的添加行按钮和回到顶部按钮配置
+              allowEdit: false, // 是否允许前台编辑
+              enableAddRow: false, // 是否允许增加行
+              enableAddCol: false, // 是否允许增加列
+              sheetFormulaBar: false, // 是否显示公式栏
+              enableAddBackTop: false, // 返回头部按钮
+              showsheetbar: true, // 是否显示底部sheet页按钮
+              enableAddRow: false, //允许添加行
+              // 自定义配置底部sheet页按钮
+              showsheetbarConfig: {
+                add: false,
+                menu: false,
               },
               },
-              cellUpdated: function (r, c, oldValue, newValue, isRefresh) {
-                // console.log("r",r);
-                // console.log("c",c);
-                // console.log("oldVal",oldValue);
-                // console.log("newVal",newValue);
-                //   console.log('exportJson',_this.dataForm.source_data.exportJson)
+              hook: {
+                cellMousedown: function (cell, position, sheetFile, ctx) {
+                  _this.position.sheet = sheetFile.name;
+
+                  _this.position.r = position.r;
+                  _this.position.c = position.c;
+
+                  if (cell.v) {
+                    _this.position.value = cell.v;
+                  } else {
+                    _this.position.value = "";
+                    cell.ct.s.map((res) => {
+                      _this.position.value += res.v;
+                    });
+                  }
+                  _this.showConfirm = true;
+                },
+                cellUpdated: function (r, c, oldValue, newValue, isRefresh) {
+                  // console.log("r",r);
+                  // console.log("c",c);
+                  // console.log("oldVal",oldValue);
+                  // console.log("newVal",newValue);
+                  //   console.log('exportJson',_this.dataForm.source_data.exportJson)
+                },
               },
               },
-            },
+            });
           });
           });
-        });
-
-
- //        _this.dataForm=res.data;
- //        _this.dataForm.sourceData=JSON.parse(_this.dataForm.source_data);
-
-
-      },
-      initTableList(){
-        let _this=this;
-        searchSourceData({page:1,pageSize:999,status:5}).then(res=>{
-          if(res.status!=200)return;
-          _this.tableList=res.data.dataList;
         })
         })
-      },
+        .finally(() => {
+          _this.loading = false; // 结束加载
+        });
 
 
-    }
-  }
+      //        _this.dataForm=res.data;
+      //        _this.dataForm.sourceData=JSON.parse(_this.dataForm.source_data);
+    },
+    initTableList() {
+      let _this = this;
+      searchSourceData({ page: 1, pageSize: 999, status: 5 }).then((res) => {
+        if (res.status != 200) return;
+        _this.tableList = res.data.dataList;
+      });
+    },
+  },
+};
 </script>
 </script>
 
 
 <style lang="scss">
 <style lang="scss">
-@import './index.scss';
+@import "./index.scss";
 </style>
 </style>

+ 14 - 3
src/views/document/com/components/TextArea/index.vue

@@ -376,7 +376,8 @@ export default {
           let result = await _this.getRemote1(_this.com.attrs[i].formula);
           let result = await _this.getRemote1(_this.com.attrs[i].formula);
           data = data.replace("{{" + attrId + "}}", result);
           data = data.replace("{{" + attrId + "}}", result);
         } else if (_this.com.attrs[i].type == "Directory") {
         } else if (_this.com.attrs[i].type == "Directory") {
-          const directoryContent = _this.com.attrs[i].number+'. '+_this.com.attrs[i].content;
+          const directoryContent =
+            _this.com.attrs[i].number + ". " + _this.com.attrs[i].content;
           const level = _this.com.attrs[i].level || 1; // 默认为1级目录
           const level = _this.com.attrs[i].level || 1; // 默认为1级目录
           const attrId = _this.com.attrs[i].id;
           const attrId = _this.com.attrs[i].id;
 
 
@@ -775,17 +776,27 @@ export default {
       // 如果正在编辑,直接获取数据而不显示进度条
       // 如果正在编辑,直接获取数据而不显示进度条
       try {
       try {
         let res = await findData(par);
         let res = await findData(par);
-        if (res.status == 200) {
+        // 添加响应检查
+        if (!res) {
+          console.warn("No response received from findData");
+          return result;
+        }
+
+        // 检查响应格式
+        if (res.status === 200 && res.data) {
           result = res.data.result;
           result = res.data.result;
           // 添加数据类型检查和转换
           // 添加数据类型检查和转换
           if (typeof result === "string" && !isNaN(result)) {
           if (typeof result === "string" && !isNaN(result)) {
             result = parseFloat(result);
             result = parseFloat(result);
           }
           }
+        } else {
+          console.warn("Invalid response format:", res);
         }
         }
       } catch (error) {
       } catch (error) {
         console.error("获取远程数据错误:", error);
         console.error("获取远程数据错误:", error);
+        // 可以在这里添加错误通知
+        this.$message && this.$message.error("获取远程数据失败");
       }
       }
-      /*   } */
 
 
       return result;
       return result;
     },
     },

+ 5 - 4
src/views/document/com/editor.vue

@@ -77,7 +77,7 @@
                   <!-- <el-col :span="6">
                   <!-- <el-col :span="6">
                     <el-form-item label="模块描述:">
                     <el-form-item label="模块描述:">
                       <el-input
                       <el-input
-                        v-if="$store.state.user.id == 1"
+                        v-if="$store.state.user.roleInfo.id == 1"
                         class="input-item"
                         class="input-item"
                         v-model="it.intro"
                         v-model="it.intro"
                         placeholder="请填写模块介绍"
                         placeholder="请填写模块介绍"
@@ -86,7 +86,7 @@
                     </el-form-item>
                     </el-form-item>
                   </el-col> -->
                   </el-col> -->
                   <el-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
                   <el-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
-                    <el-form-item v-if="$store.state.user.id == 1">
+                    <el-form-item v-if="$store.state.user.roleInfo.id == 1">
                       <div class="btn-save">
                       <div class="btn-save">
                         <el-tooltip
                         <el-tooltip
                           v-if="type !== 'document'"
                           v-if="type !== 'document'"
@@ -322,6 +322,7 @@ export default {
     };
     };
   },
   },
   mounted() {
   mounted() {
+    console.log(this.$store.state);
     this.initCategoryList();
     this.initCategoryList();
     this.type = this.$route.query.type;
     this.type = this.$route.query.type;
     this.templateId = this.$route.query.templateId;
     this.templateId = this.$route.query.templateId;
@@ -420,7 +421,7 @@ export default {
     showCategoryName(item) {
     showCategoryName(item) {
       return (
       return (
         this.type == "module" &&
         this.type == "module" &&
-        this.$store.state.user.id == 1 &&
+        this.$store.state.user.roleInfo.id == 1 &&
         !item.valDisabled
         !item.valDisabled
       );
       );
     },
     },
@@ -431,7 +432,7 @@ export default {
     showCategorySelect(item) {
     showCategorySelect(item) {
       return (
       return (
         this.type === "module" &&
         this.type === "module" &&
-        this.$store.state.user.id === 1 &&
+        this.$store.state.user.roleInfo.id === 1 &&
         !item.selDisabled
         !item.selDisabled
       );
       );
     },
     },

+ 2 - 2
src/views/document/com/menus.vue

@@ -192,11 +192,11 @@ export default {
               disabled: () =>this.typeMenu === "module" || this.typeMenu === undefined,
               disabled: () =>this.typeMenu === "module" || this.typeMenu === undefined,
             },
             },
 
 
-            /* {
+            {
                 key:"SourceData",
                 key:"SourceData",
                 name:"源数据",
                 name:"源数据",
                 icon:"sourceData",
                 icon:"sourceData",
-              }, */
+              },
             {
             {
               key: "formual",
               key: "formual",
               name: "公式",
               name: "公式",

+ 3 - 3
src/views/middPage/list.vue

@@ -124,8 +124,6 @@
               <el-link @click="handleNameClick(row)">{{ row.name }}</el-link>
               <el-link @click="handleNameClick(row)">{{ row.name }}</el-link>
             </template>
             </template>
           </el-table-column>
           </el-table-column>
-          <el-table-column prop="create_time" label="创建时间" />
-          <el-table-column prop="type" label="文档类型" width="100" />
           <el-table-column prop="tags" label="已绑定标签">
           <el-table-column prop="tags" label="已绑定标签">
             <template #default="{ row }">
             <template #default="{ row }">
               <el-tag
               <el-tag
@@ -138,7 +136,9 @@
               </el-tag>
               </el-tag>
             </template>
             </template>
           </el-table-column>
           </el-table-column>
-          <el-table-column prop="status" label="处理状态">
+          <el-table-column prop="type" label="文档类型" width="100" />
+          <el-table-column prop="create_time" label="创建时间" width="200"/>
+          <el-table-column prop="status" label="处理状态" width="100">
             <template #default="{ row }">
             <template #default="{ row }">
               <el-tag :type="getStatusType(row.status)">
               <el-tag :type="getStatusType(row.status)">
                 {{ getStatusText(row.status) }}
                 {{ getStatusText(row.status) }}

Some files were not shown because too many files changed in this diff