瀏覽代碼

添加加载框处理变量及公式联动

yangg 10 月之前
父節點
當前提交
09efd6a2be

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


+ 0 - 0
dist/static/css/chunk-2234fa65.7131743c.css → dist/static/css/chunk-38eed32f.7131743c.css


+ 0 - 0
dist/static/css/chunk-a2efe74a.97a8613a.css → dist/static/css/chunk-684d1b1b.97a8613a.css


+ 0 - 0
dist/static/css/chunk-551d786c.7131743c.css → dist/static/css/chunk-ce93e8ec.7131743c.css


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


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-2234fa65.44b6a854.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-38eed32f.a30e2169.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-551d786c.68fcee43.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-684d1b1b.6e5b158c.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-a2efe74a.49189f2f.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-ce93e8ec.cb7e7423.js


+ 33 - 1
src/views/document/com/components/Attribute/attributeVar/index.vue

@@ -5,7 +5,11 @@
         <template v-if="com.type == 'TextArea'">
           <template v-if="isTextAreaType(sub.type)">
             <el-form-item :label="sub.name + ' (引用名:[' + sub.id + '])'">
-              <el-input type="textarea" v-model="sub.content"></el-input>
+              <el-input
+                type="textarea"
+                @input="updateAllReferences(sub, $event)"
+                v-model="sub.content"
+              ></el-input>
             </el-form-item>
           </template>
           <template v-if="sub.type == 'formual'">
@@ -95,6 +99,34 @@ export default {
     }
   },
   methods: {
+    updateAllReferences(val, newValue) {
+      this.com.attrs.map((el) => {
+        if (el.name == val.name) {
+          el.content = newValue;
+        }
+      });
+
+      /*  this.processedAttrs.forEach((attr) => {
+        if (attr.id === id) {
+          attr.content = newValue;
+        }
+      });
+
+      // Update the original com.attrs as well
+      if (this.com && this.com.attrs) {
+        this.com.attrs.forEach((attr) => {
+          if (attr.id === id) {
+            attr.content = newValue;
+          }
+        });
+      }
+
+      // Update the content of the component
+      if (this.com && this.com.content) {
+        const regex = new RegExp(`\\{\\{${id}\\}\\}`, "g");
+        this.com.content = this.com.content.replace(regex, `{{${newValue}}}`);
+      } */
+    },
     isTextAreaType(type) {
       return ![
         "pager",

+ 19 - 9
src/views/document/components/dataList.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="data-list">
+  <div class="data-list" v-loading="loading" element-loading-text="加载中...">
     <el-table
       :data="dataList"
       style="width: 100%"
@@ -116,6 +116,7 @@ export default {
   },
   data() {
     return {
+      loading: false,
       dialogVisible: false, //控制产品审核
       currentDataId: 0,
       recordCount: 0,
@@ -197,14 +198,23 @@ export default {
     //搜索
     search() {
       let _this = this;
-      searchDocument(_this.queryForm).then((res) => {
-        if (!res) return;
-       /*  res.data.dataList.filter(el => el.is_template == 0)
-        console.log(res.data.dataList); */
-        _this.dataList = res.data.dataList.filter(el => el.is_template == 0);
-        _this.recordCount = res.data.totalRecord;
-        _this.pageTotal = res.data.pageTotal;
-      });
+      _this.loading = true; // Set loading to true before API call
+      searchDocument(_this.queryForm)
+        .then((res) => {
+          if (!res) {
+            _this.loading = false; // Set loading to false if no response
+            return;
+          }
+          _this.dataList = res.data.dataList.filter(
+            (el) => el.is_template == 0
+          );
+          _this.recordCount = res.data.totalRecord;
+          _this.pageTotal = res.data.pageTotal;
+          _this.loading = false; // Set loading to false after data is processed
+        })
+        .catch(() => {
+          _this.loading = false; // Set loading to false if there's an error
+        });
     },
     //修改分页
     ChangePage(e) {

+ 1 - 0
src/views/document/create.vue

@@ -453,6 +453,7 @@ export default {
           }
         }
       }
+      console.log(this.coms);
       return data;
     },
     //分析公式

+ 197 - 163
src/views/document/temList/components/dataList.vue

@@ -1,188 +1,222 @@
 <template>
-  <div class="data-list">
-
-
-      <el-table :data="dataList" style="width: 100%" header-row-class-name="headerBg" empty-text="没有模板信息">
-        <el-table-column prop="id" label="ID" align="center" width="80"/>
-        <el-table-column prop="title" label="模板名称" align="left" min-width="180"/>
-        <el-table-column prop="category.name" label="所属分类" align="center" width="150"/>
-        <el-table-column prop="createTime" label="创建时间" align="center" width="150"/>
-        <el-table-column prop="status" label="模板状态" align="center" width="150">
-          <template #default="scope">
-              <div v-if="scope.row.status==5">启用</div>
-              <div v-if="scope.row.status==6">停用</div>
-          </template>
-        </el-table-column>
-        <el-table-column label="操作" align="center" :width="editWidth()">
-          <template #default="scope">
-            <div class="btns">
-              <el-button type="primary" size="small" v-if="allowEdit" @click="btnEdit(scope.row.id)"><svg-icon icon-class="edit"/>编辑</el-button>
-
-              <el-button type="danger" size="small" v-if="allowDelete" @click="btnDelete(scope.row.id)"><svg-icon icon-class="delete"/>删除</el-button>
-            </div>
-          </template>
-        </el-table-column>
-      </el-table>
-
-      <div class="page-info">
-      	<el-pagination
-      	v-model:currentPage="queryForm.page"
-      	:page-size="queryForm.pageSize"
-      	:total="recordCount"
-      	:page-count="pageTotal"
-      	 background
-      	 layout="prev, pager, next"
-      	 @current-change="ChangePage"
-      	 >
-      	 </el-pagination>
-      </div>
-
-
+  <div class="data-list" v-loading="loading" element-loading-text="加载中...">
+    <el-table
+      :data="dataList"
+      style="width: 100%"
+      header-row-class-name="headerBg"
+      empty-text="没有模板信息"
+    >
+      <el-table-column prop="id" label="ID" align="center" width="80" />
+      <el-table-column
+        prop="title"
+        label="模板名称"
+        align="left"
+        min-width="180"
+      />
+      <el-table-column
+        prop="category.name"
+        label="所属分类"
+        align="center"
+        width="150"
+      />
+      <el-table-column
+        prop="createTime"
+        label="创建时间"
+        align="center"
+        width="150"
+      />
+      <el-table-column
+        prop="status"
+        label="模板状态"
+        align="center"
+        width="150"
+      >
+        <template #default="scope">
+          <div v-if="scope.row.status == 5">启用</div>
+          <div v-if="scope.row.status == 6">停用</div>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" :width="editWidth()">
+        <template #default="scope">
+          <div class="btns">
+            <el-button
+              type="primary"
+              size="small"
+              v-if="allowEdit"
+              @click="btnEdit(scope.row.id)"
+              ><svg-icon icon-class="edit" />编辑</el-button
+            >
+
+            <el-button
+              type="danger"
+              size="small"
+              v-if="allowDelete"
+              @click="btnDelete(scope.row.id)"
+              ><svg-icon icon-class="delete" />删除</el-button
+            >
+          </div>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <div class="page-info">
+      <el-pagination
+        v-model:currentPage="queryForm.page"
+        :page-size="queryForm.pageSize"
+        :total="recordCount"
+        :page-count="pageTotal"
+        background
+        layout="prev, pager, next"
+        @current-change="ChangePage"
+      >
+      </el-pagination>
+    </div>
   </div>
-
-
 </template>
 
 <script>
-  import{searchDocument,deleteDocument} from'@/api/document';
-  export default{
-
-    props:{
-      queryForm:{
-        type:Object,
-        default:()=>{
-          return {
-           page:1,
-           pageSize:10,
-           title:'',
-           category_id:'',
-           status:'',
-          }
-        }
-      },
-      allowEdit:{
-        type:Boolean,
-        default:false,
+import { searchDocument, deleteDocument } from "@/api/document";
+export default {
+  props: {
+    queryForm: {
+      type: Object,
+      default: () => {
+        return {
+          page: 1,
+          pageSize: 10,
+          title: "",
+          category_id: "",
+          status: "",
+        };
       },
-      allowDelete:{
-        type:Boolean,
-        default:false,
-      }
-    },
-    watch:{
-
-        'queryForm': {
-          handler: function(val) {
-
-            this.search();
-          },
-          // immediate: true,//立即执行
-          deep: true
-
-        },
     },
-    data(){
-      return{
-        dialogVisible:false,//控制产品审核
-        currentDataId:0,
-        recordCount:0,
-        pageTotal:1,
-        dataList:[],
-        currentData:{},
-      }
+    allowEdit: {
+      type: Boolean,
+      default: false,
     },
-    mounted() {
-      this.search();
+    allowDelete: {
+      type: Boolean,
+      default: false,
     },
-    methods:{
-
-      editWidth(){
-        if(this.allowDelete && this.allowEdit){
-          return 200;
-        }
-        if(this.allowDelete||this.allowEdit){
-          return 120;
-        }
-        return 100;
-      },
-
-
-      onFocusVal(e){
-        let _this=this;
-        _this.currentDataId=e.target.dataset.id;
+  },
+  watch: {
+    queryForm: {
+      handler: function (val) {
+        this.search();
       },
+      // immediate: true,//立即执行
+      deep: true,
+    },
+  },
+  data() {
+    return {
+      loading: false,
+      dialogVisible: false, //控制产品审核
+      currentDataId: 0,
+      recordCount: 0,
+      pageTotal: 1,
+      dataList: [],
+      currentData: {},
+    };
+  },
+  mounted() {
+    this.search();
+  },
+  methods: {
+    editWidth() {
+      if (this.allowDelete && this.allowEdit) {
+        return 200;
+      }
+      if (this.allowDelete || this.allowEdit) {
+        return 120;
+      }
+      return 100;
+    },
 
-      onChangeVal(e){
-        let _this=this;
-        let par={
-          id:_this.currentDataId,
-          val:e,
-        };
+    onFocusVal(e) {
+      let _this = this;
+      _this.currentDataId = e.target.dataset.id;
+    },
 
-      },
+    onChangeVal(e) {
+      let _this = this;
+      let par = {
+        id: _this.currentDataId,
+        val: e,
+      };
+    },
 
-      btnDelete(e){
-        let _this=this;
-        let par={
-          id:e,
-        }
-        _this.$confirm("您是否确认删除该记录?","提示",{
-          confirmButtonText: '确认',
-          cancelButtonText: '取消',
-          type: 'warning',
-        }).then((res)=>{
+    btnDelete(e) {
+      let _this = this;
+      let par = {
+        id: e,
+      };
+      _this
+        .$confirm("您是否确认删除该记录?", "提示", {
+          confirmButtonText: "确认",
+          cancelButtonText: "取消",
+          type: "warning",
+        })
+        .then((res) => {
           // console.log("AAA")
-             deleteDocument(par).then(res=>{
-               _this.search();
-             })
-        }).catch(()=>{
+          deleteDocument(par).then((res) => {
+            _this.search();
+          });
         })
-      },
-
-      searchData(){
-        let _this=this;
-        _this.dialogVisible=false;
-        _this.search();
-      },
+        .catch(() => {});
+    },
 
+    searchData() {
+      let _this = this;
+      _this.dialogVisible = false;
+      _this.search();
+    },
 
-      //编辑
-      btnEdit(e){
-        let _this=this;
-        let a=document.createElement("a");
-        a.href="#/document/create?articleId="+e;
-        a.target="_blank";
-        a.click();
+    //编辑
+    btnEdit(e) {
+      let _this = this;
+      let a = document.createElement("a");
+      a.href = "#/document/create?articleId=" + e;
+      a.target = "_blank";
+      a.click();
 
-        // _this.$router.push({path:"/document/create",query:{articleId:e}})
-      },
+      // _this.$router.push({path:"/document/create",query:{articleId:e}})
+    },
 
-      handleClose(){
-        let _this=this;
-        _this.currentData={};
-        _this.dialogVisible=false;
-      },
+    handleClose() {
+      let _this = this;
+      _this.currentData = {};
+      _this.dialogVisible = false;
+    },
 
-      //搜索
-      search(){
-        let _this=this;
-        searchDocument(_this.queryForm).then(res=>{
-          if(!res)return;
-          _this.dataList=res.data.dataList.filter(el => el.is_template == 1);
-          _this.recordCount=res.data.totalRecord;
-          _this.pageTotal=res.data.pageTotal;
+    //搜索
+    search() {
+      let _this = this;
+      _this.loading = true; // Set loading to true before API call
+      searchDocument(_this.queryForm)
+        .then((res) => {
+          if (!res) return;
+          _this.dataList = res.data.dataList.filter(
+            (el) => el.is_template == 1
+          );
+          _this.recordCount = res.data.totalRecord;
+          _this.pageTotal = res.data.pageTotal;
+          _this.loading = false; // Set loading to false after data is processed
         })
-      },
-      //修改分页
-      ChangePage(e){
-      	let _this=this;
-      	_this.queryForm.page=e;
-      	_this.search();
-      },
-    }
-  }
+        .catch(() => {
+          _this.loading = false; // Set loading to false if there's an error
+        });
+    },
+    //修改分页
+    ChangePage(e) {
+      let _this = this;
+      _this.queryForm.page = e;
+      _this.search();
+    },
+  },
+};
 </script>
 
 <style lang="scss">
-@import './dataList.scss';
+@import "./dataList.scss";
 </style>

+ 0 - 0
src/views/knowledgeMenu/knowledgeList.vue


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